blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
201
content_id
stringlengths
40
40
detected_licenses
listlengths
0
85
license_type
stringclasses
2 values
repo_name
stringlengths
7
100
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
260 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
11.4k
681M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
80 values
src_encoding
stringclasses
28 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
8
9.86M
extension
stringclasses
52 values
content
stringlengths
8
9.86M
authors
listlengths
1
1
author
stringlengths
0
119
d6cc56ec5638b697e6d2cc1749e628c737aaa012
a734f2ab729e2f36d4f5b3a7617dd3eaf5199c01
/Leetcode/Trees/222_Count_complete_tree_nodes.cpp
01eee5eedd64c8b908dad50bab263fc8c825e995
[]
no_license
shash04/General_Coding
54b889d919b1de7d152a9e585ff604ed8c6a3b2b
7d12479db221c4324e6254b88869997ce110866f
refs/heads/master
2021-01-13T10:39:10.832265
2020-12-14T04:52:00
2020-12-14T04:52:00
69,840,301
1
1
null
null
null
null
UTF-8
C++
false
false
1,510
cpp
// Given a complete binary tree, count the number of nodes. // Note: // Definition of a complete binary tree from Wikipedia: // In a complete binary tree every level, except possibly the last, is completely filled, and all nodes in the // last level are as far left as possible. It can have between 1 and 2h nodes inclusive at the last level h. // Example: // Input: // 1 // / \ // 2 3 // / \ / // 4 5 6 // Output: 6 // https://leetcode.com/problems/count-complete-tree-nodes/ // Walk all the way left and right to determine the height and whether it's a full tree, meaning the last row is full // If so, then the answer is just 2^height-1 // And since always at least one of the two recursive calls is such a full tree, at least one of the two calls immediately stops // Runtime complexity is O(log(n)^2) class Solution { public: int countNodes(TreeNode* root) { if(!root) return 0; TreeNode* leftTree = root; TreeNode* rightTree = root; int leftHeight = 0, rightHeight = 0; while(leftTree) { leftHeight++; leftTree = leftTree->left; } while(rightTree) { rightHeight++; rightTree = rightTree->right; } if(leftHeight == rightHeight) return pow(2, leftHeight) - 1; return 1 + countNodes(root->left) + countNodes(root->right); } };
[ "noreply@github.com" ]
noreply@github.com
7c2771187d49160a1a31c2b5a78be2baecc291d5
962476e8b1a5e1ddde58a980402541adf23a13bf
/LLY/LLY/resource/track.cpp
5d31c1d232365f09296bdfe918a3464bdcc7a0e1
[ "MIT" ]
permissive
ooeyusea/GameEngine
c9f925a5bc88d69b118d7a10dafeba72fcf82813
85e7ceef7ddf663f9601a8a8787e29e8e8cdb425
refs/heads/master
2021-01-02T08:52:39.788919
2015-07-06T14:00:07
2015-07-06T14:00:07
33,131,532
3
0
null
null
null
null
UTF-8
C++
false
false
933
cpp
#include "track.h" #include "key_frame.h" namespace lly { void Track::get_interpolate_frame(KeyFrame& frame) { if (_frames.empty()) throw std::logic_error("empty frame"); size_t i = 0; while (i < _frames.size()) { if (frame.get_time_pos() < _frames[i]->get_time_pos()) { break; } ++i; } if (i == _frames.size()) { frame.interpolate_from(_frames[i - 1], _frames[i - 1]); } else if (i == 0) { frame.interpolate_from(_frames[i], _frames[i]); } else frame.interpolate_from(_frames[i - 1], _frames[i]); } void NodeTrack::apply(Skeleton* skeleton, float time_pos, float weight) { TransformFrame frame(time_pos); get_interpolate_frame(frame); frame.apply(skeleton, this, weight); } }
[ "ooeyusea@gmail.com" ]
ooeyusea@gmail.com
46736207a4efbe20f7c5477c2dc486dff80a4214
c92c442fcdd4442f23e97dd73382f96b41376c87
/SourceCode/Common/GateWay.cpp
473e7e53f47c73577ee90d0636861e7fe5ede728
[]
no_license
hackerlank/akx
2e56ab90ce5cf8f69dfaba75efe4e5604aa4a476
a15489e27c4495b6d5d3c84bf6fff8bec00166e6
refs/heads/master
2020-03-12T06:17:33.802783
2017-10-01T16:00:53
2017-10-01T16:00:53
null
0
0
null
null
null
null
GB18030
C++
false
false
41,811
cpp
#include "stdafx.h" #include "UDPServer.h" #include "Cmd_Fish.h" #define UDP_PER_RECV_COUNT 3 #define UDP_CMD_VECTOR_SIZE 32 #define UDP_MTU 512 #define UDP_MAX_SEND_SIZE 2048 #define BUFF_MIN_SIZE 4096 #define UDP_CLIENT_MIN_SIZE 4 #define THREAD_ACCEPT_COUNT 512 //单个线程接收的容器数量 #define UDP_VALIDATION_TICK 50 #define UDP_VALIDATION_ID 0x8fffffff #define UDP_BUFF_SIZE 2048 #define HEARBEAT_TICK 1000 #define UDP_MIN_INTERVAL 5 const int UDP_MIN_CMD_SIZE = sizeof(UINT)+sizeof(UINT)+sizeof(NetCmd); const UINT LOGON_SUCCESS_ID = (Main_Logon << 8) | LC_AccountOnlyID; const UINT GAME_SUCCESS_ID = (Main_Logon << 8) | LC_AccountOnlyIDSuccess; static UINT WINAPI ThreadAccept(void *p) { ((NewGateServer*)p)->_ThreadAccept(); return 0; } static UINT WINAPI ThreadRecv(void *p) { ((NewGateServer*)p)->_ThreadRecv(); return 0; } static UINT WINAPI LogonThreadRecv(void *p) { ((NewGateServer*)p)->_ThreadLogonRecv(); return 0; } static UINT WINAPI LogonThreadAccept(void *p) { ((NewGateServer*)p)->_ThreadLogonAccept(); return 0; } static UINT WINAPI OperationThreadRecv(void *p) { ((NewGateServer*)p)->_ThreadOperationRecv(); return 0; } static UINT WINAPI OperationThreadAccept(void *p) { ((NewGateServer*)p)->_ThreadOperationAccept(); return 0; } enum { SEND_NONE, SEND_WAIT_NEWPORT, SEND_WAIT_HEARBEAT, }; struct AcceptUDPClient { SOCKADDR_IN ClientAddr; SOCKET ClientSocket; SOCKET NewSocket; USHORT NewPort; UINT Tick; UINT SendTick; UINT ServerIP; USHORT ServerPort; UINT Rand1; UINT Rand2; BYTE SendType; BYTE SendCount; bool Removed; }; NewGateServer::NewGateServer() :m_OperationThreadData(256) { } NewGateServer::~NewGateServer() { } static void InnerGetIPString(SOCKADDR_IN &addr, char *buff) { UINT ip = addr.sin_addr.S_un.S_addr; ushort port = ntohs(addr.sin_port); GetIPString(ip, port, buff); } bool NewGateServer::Init(const GWInitData &data, bool btcp) { WSADATA wsaData; if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) { Log("WSAStartup Failed."); return false; } m_LogonIndex = 0; m_bAccept = true; memset(m_RecvThreadData, 0, sizeof(m_RecvThreadData)); m_ExitIndex = 0; m_OnlineNum = 0; m_RecvIndex = 0; m_bRun = true; memcpy(&m_InitData, &data, sizeof(data)); m_InitData.LogonThreadNum = min(m_InitData.LogonThreadNum, MAX_THREAD_NUM); m_InitData.RecvThreadNum = min(m_InitData.RecvThreadNum, MAX_THREAD_NUM); inet_pton(AF_INET, m_InitData.LocalServerIP, &m_LocalIP); CreateSocketData csd; bool bret = CreateSocket(CST_TCP | CST_BIND, m_InitData.Port, data.SocketRecvSize, data.SocketSendSize, csd); if (!bret) { Log("CreateSocket Failed."); return false; } m_Socket = csd.Socket; int nRet = ::listen(m_Socket, data.ListenCount); if (nRet != 0) { Log("listen Failed:%d.", WSAGetLastError()); return false; } //Logon //------------------------------------------------- nRet = CreateSocket(CST_BIND | CST_TCP, m_InitData.LogonClientPort, 4096, 4096, csd); if (nRet == false) { Log("CreateSocket Failed:%d.", WSAGetLastError()); return false; } m_LogonSocket = csd.Socket; nRet = ::listen(m_LogonSocket, m_InitData.ListenCount); if (nRet != 0) { Log("listen Failed:%d.", WSAGetLastError()); return false; } //Operation //------------------------------------------------- nRet = CreateSocket(CST_BIND | CST_TCP, m_InitData.OperationClientPort, 4096, 4096, csd); if (nRet == false) { Log("CreateSocket Failed:%d.", WSAGetLastError()); return false; } m_OperationSocket = csd.Socket; nRet = ::listen(m_OperationSocket, m_InitData.ListenCount); if (nRet != 0) { Log("listen Failed:%d.", WSAGetLastError()); return false; } //创建线程数据 for (int i = 0; i < data.RecvThreadNum; ++i) { m_RecvThreadData[i] = new GWRecvThreadData(THREAD_ACCEPT_COUNT); m_RecvThreadData[i]->OnlineNum = 0; } //创建线程 ::_beginthreadex(0, 0, ThreadAccept, this, 0, 0); for (int i = 0; i < data.RecvThreadNum; ++i) { ::_beginthreadex(0, 0, ThreadRecv, this, 0, 0); } ::_beginthreadex(0, 0, LogonThreadAccept, this, 0, 0); //创建Logon线程 //===================================================== for (UINT i = 0; i < data.LogonThreadNum; ++i) { m_LogonThreadData[i] = new GWLogonThreadData(THREAD_ACCEPT_COUNT); m_LogonThreadData[i]->OnlineNum = 0; } for (UINT i = 0; i < data.LogonThreadNum; ++i) { ::_beginthreadex(0, 0, LogonThreadRecv, this, 0, 0); } //创建Operation线程 //===================================================== ::_beginthreadex(0, 0, OperationThreadAccept, this, 0, 0); ::_beginthreadex(0, 0, OperationThreadRecv, this, 0, 0); Log("%d号服务已启动(SendThreadNum:%d, RecvThreadNum:%d, SendBuff:%d, RecvBuff:%d, SendCmdCount:%d, RecvCmdCount:%d, BuffSize:%d, SceneTick:%d, Timeout:%d, Valid:%d)", m_InitData.ServerID, m_InitData.SendThreadNum, m_InitData.RecvThreadNum, m_InitData.SocketSendSize, m_InitData.SocketRecvSize, m_InitData.MaxSendCmdCount, m_InitData.MaxRecvCmdCount, m_InitData.BuffSize, m_InitData.SceneHearbeatTick, m_InitData.Timeout, m_InitData.AcceptRecvData ); return true; } //优化UDP: //1.有新命令立即发送 //2.一直读取数据,直到无法读取。 void NewGateServer::GetRecvIndex(ushort &recvIdx) { recvIdx = USHRT_MAX; int num = USHRT_MAX; for (WORD i = 0; i < m_InitData.RecvThreadNum; ++i) { if (m_RecvThreadData[i]->NewClientList.HasSpace() && m_RecvThreadData[i]->OnlineNum < num) { num = m_RecvThreadData[i]->OnlineNum; recvIdx = i; } } } bool NewGateServer::RecvDataByUDPServer(GWClientData *pc, char *Buff, int nSize, UINT tick) { UNREFERENCED_PARAMETER(tick); char *pBuff = Buff; char *pEnd = Buff + nSize; while (pBuff < pEnd) { UINT recvID = *((UINT*)(pBuff)); pBuff += 4; if (recvID == HEARBEAT_ID || recvID == PING_ID) //心跳 { } else if (IS_ANSWER(recvID)) //收到回复 { if (IS_GW_ANSWER(recvID)) { /*if (pc->InnerIsInScene == false) { Log("<<进入场景>>"); }*/ pc->InnerIsInScene = true; RESET_GW_ANSWER(recvID); } else { /*if (pc->InnerIsInScene) { Log("<<离开场景>>"); }*/ pc->InnerIsInScene = false; RESET_ANSWER(recvID); } //Log("Recv Answer:%d, sendSize:%d", recvID, pc->SendSize); if (recvID == pc->ServerSendID && pc->pServerSendBuff != null) { free(pc->pServerSendBuff); pc->pServerSendBuff = NULL; } } else { //收到命令 NetCmd *pcmd = (NetCmd*)pBuff; if (pcmd->GetCmdSize() > m_InitData.BuffSize || pcmd->GetCmdSize() > pEnd - pBuff) { Log("命令的长度不正确2:%d, %d, %d,nSize=%d,cmdtype=%d", pcmd->GetCmdSize(), m_InitData.BuffSize, pEnd - pBuff, nSize, pcmd->GetCmdType()); pc->RemoveCode = REMOVE_CMD_SIZE_ERROR; pc->Removed = true; return false; } else if (recvID == pc->ServerRecvID + 1) { //对方第一次发送的命令 ++pc->ServerRecvID; UINT *pRecvCmd = (UINT*)malloc(pcmd->GetCmdSize() + sizeof(UINT)* 2); memcpy(pRecvCmd + 2, pcmd, pcmd->GetCmdSize()); if (pc->RecvServerList.HasSpace()) pc->RecvServerList.AddItem(pRecvCmd); else { Log("UDP Server接收空间已满"); pc->RemoveCode = REMOVE_CMD_RECV_OVERFLOW; pc->Removed = true; } } else { //Log("Recv OldID:%d, CurID:%d", recvID, pc->RecvID); } pc->bServerSendBackID = true; pBuff += pcmd->GetCmdSize(); } }//end while return true; } bool NewGateServer::RecvDataByUDP(GWClientData *pc, char *Buff, int nSize, UINT tick) { UNREFERENCED_PARAMETER(tick); char *pBuff = Buff; char *pEnd = Buff + nSize; while (pBuff < pEnd) { UINT recvID = *((UINT*)(pBuff)); pBuff += 4; if (recvID == HEARBEAT_ID || recvID == PING_ID) //心跳 { //UINT delta = timeGetTime() - pc->SendTick; //Log("Recv Hearbeat:%d", delta); } else if (IS_ANSWER(recvID)) //收到回复 { RESET_ANSWER(recvID); //Log("Recv Answer:%d, sendSize:%d", recvID, pc->SendSize); if (recvID == pc->SendID && pc->SendSize != 0) { //Log("SendCmdOK, count:%d", pc->SendCmdCount); pc->ResendCount = 0; pc->SendSize = 0; if (pc->pSendBuff != (UINT*)pc->Buff) { free(pc->pSendBuff); pc->pSendBuff = NULL; } } } else { //收到命令 NetCmd *pcmd = (NetCmd*)pBuff; if (pcmd->GetCmdSize() > m_InitData.BuffSize || pcmd->GetCmdSize() > pEnd - pBuff) { Log("命令的长度不正确3:%d, %d, %d,nSize=%d,cmdtype=%d", pcmd->GetCmdSize(), m_InitData.BuffSize, pEnd - pBuff, nSize, pcmd->GetCmdType()); pc->RemoveCode = REMOVE_CMD_SIZE_ERROR; pc->Removed = true; return false; } else if (recvID == pc->RecvID + 1) { //对方第一次发送的命令 ++pc->RecvID; UINT *pRecvCmd = (UINT*)malloc(pcmd->GetCmdSize() + sizeof(UINT)* 2); memcpy(pRecvCmd + 2, pcmd, pcmd->GetCmdSize()); if (pcmd->GetCmdType() == GAME_SUCCESS_ID) { //替换运营服务器IP LC_Cmd_AccountOnlyIDSuccess * pGameCmd = (LC_Cmd_AccountOnlyIDSuccess*)(pRecvCmd + 2); pGameCmd->OperateIp = m_LocalIP; } if (pc->RecvClientList.HasSpace()) pc->RecvClientList.AddItem(pRecvCmd); else { Log("UDP Client接收空间已满"); pc->RemoveCode = REMOVE_CMD_RECV_OVERFLOW; pc->Removed = true; } } else { //Log("Recv OldID:%d, CurID:%d", recvID, pc->RecvID); } pc->bSendBackID = true; pBuff += pcmd->GetCmdSize(); } }//end while return true; } void SendBackID(GWClientData *pc, UINT tick) { UINT backID = SET_ANSWER(pc->RecvID); pc->SendTick = tick; int ret = send(pc->Socket, (char*)&backID, 4, 0); if (ret == 4) { pc->bSendBackID = false; } } void SendCmdData(GWClientData *pc, bool bresend, UINT tick, vector<UINT*> &tempList) { if (pc->SendSize == 0) pc->SendSize = 4; //1.拼包,计算包大小 //---------------------------------- UINT size = pc->SendSize; tempList.clear(); while (size < UDP_MTU && pc->RecvServerList.HasItem()) { UINT *curData = pc->RecvServerList.GetItemNoRemove(); NetCmd *pcmd = (NetCmd*)(curData + 2); UINT cmdSize = pcmd->GetCmdSize() + 4; if (cmdSize + size < UDP_BUFF_SIZE) { tempList.push_back(curData); pc->RecvServerList.RemoveTopItem(); size += cmdSize; } else break; } //2.多个包还是单个包 //---------------------------------- if (size != pc->SendSize) { if (bresend || tempList.size() > 1) { //现有包 + 新包 if (pc->pSendBuff) { //使用pc->Buff; if (pc->pSendBuff != (UINT*)pc->Buff) { memcpy(pc->Buff, pc->pSendBuff, pc->SendSize); free(pc->pSendBuff); pc->pSendBuff = (UINT*)pc->Buff; } } else pc->pSendBuff = (UINT*)pc->Buff; char *pstr = ((char*)(pc->pSendBuff)) + pc->SendSize; for (UINT i = 0; i < tempList.size(); ++i) { UINT *curData = tempList[i]; NetCmd *pcmd = (NetCmd*)(curData + 2); *((UINT*)pstr) = ++pc->SendID; pstr += 4; memcpy(pstr, pcmd, pcmd->GetCmdSize()); pstr += pcmd->GetCmdSize(); free(curData); } //Log("多包发送, count:%d, size:%d, resend:%s", tempList.size() + 1, size, bresend ? "yes":"no"); } else { //单个包 pc->pSendBuff = tempList[0]; *(pc->pSendBuff + 1) = ++pc->SendID; } } pc->SendSize = size; *pc->pSendBuff = SET_ANSWER(pc->RecvID); int ret = send(pc->Socket, (char*)pc->pSendBuff, pc->SendSize, 0); pc->SendTick = tick; if (static_cast<UINT>(ret) == pc->SendSize) { pc->SendCmdTick = tick; pc->bSendBackID = false; } else pc->SendCmdTick = 0; //下次立即发送 return; } inline void IPToString(UINT ip, CHAR str[20]) { sprintf_s(str, 20, "%d.%d.%d.%d", BYTE(ip), BYTE(ip >> 8), BYTE(ip >> 16), BYTE(ip >> 24)); } bool NewGateServer::InitClientUDP(GWClientData *pc, bool bTCP) { CreateSocketData csd; if (!CreateSocket(bTCP ? CST_TCP : CST_UDP, 0, m_InitData.SocketRecvSize, m_InitData.SocketSendSize, csd)) { Log("创建服务器Socket失败."); return false; } pc->ServerSocket = csd.Socket; SOCKADDR_IN addr; int addrSize = sizeof(addr); memset(&addr, 0, sizeof(addr)); char ipstr[100]; IPToString(pc->ConnectServerIP, ipstr); inet_pton(AF_INET, ipstr, &addr.sin_addr.s_addr); addr.sin_family = AF_INET; addr.sin_port = htons(pc->ConnectServerPort); int ret = connect(pc->ServerSocket, (sockaddr*)&addr, addrSize); return ret == 0 || (WSAGetLastError() == 10035); } //连接UDP服务器超时 const UINT CONNECT_TIMEOUT = 3000; const UINT HEARBEAT = HEARBEAT_ID; void NewGateServer::CheckConnectList(GWRecvThreadData *pRecvData, vector<GWClientData*> &tempClientList, vector<GWClientData*> &clientList, char *pBuff) { uint tick = timeGetTime(); int ret = 0; for (UINT i = 0; i < tempClientList.size();) { GWClientData *pc = tempClientList[i]; if (tick - pc->RecvTick > CONNECT_TIMEOUT) { Log("GW UDP服务器端验证超时!"); RemoveClient(pc, REMOVE_TIMEOUT); ListRemoveAt(tempClientList, i); ::InterlockedDecrement(&pRecvData->OnlineNum); continue; } if (tick - pc->SendTick > 500) { send(pc->Socket, (char*)&HEARBEAT, 4, 0); pc->SendTick = tick; } switch (pc->State) { case GWS_CONNECTING: ret = recv(pc->ServerSocket, pBuff, m_InitData.BuffSize, 0); if (ret == 16 && *(UINT*)pBuff == SERVER_CONNECT_MAGIC) { closesocket(pc->ServerSocket); pc->ConnectServerPort = *((UINT*)(pBuff + 12)); if (InitClientUDP(pc, false) == false) { Log("创建UDP失败."); pc->~GWClientData(); free(pc); continue; } UINT* pSendData = (UINT*)(pBuff + 0); pc->State = GWS_SEND_VALID_DATA; pc->ValidBuff[0] = UDP_VALIDATION_ID; pc->ValidBuff[1] = *(pSendData + 1) | 0xc0000000; pc->ValidBuff[2] = *(pSendData + 2) | 0xc0000000; pc->ValidBuff[3] = pc->IP; pc->ValidBuff[4] = pc->Port; pc->SendCmdTick = tick; //Log("Rand1:%u, Rand2:%u, IP:%u", pc->ValidBuff[1], pc->ValidBuff[2], pc->ValidBuff[3]); send(pc->ServerSocket, (char*)pc->ValidBuff, 18, 0); } break; case GWS_SEND_VALID_DATA: ret = recv(pc->ServerSocket, pBuff, m_InitData.BuffSize, 0); if (ret == 4 && *(UINT*)pBuff == HEARBEAT_ID) { //发送三次心跳 send(pc->ServerSocket, (char*)&HEARBEAT, 4, 0); pc->State = GWS_SEND_HEARBEAT; pc->ResendCount = 1; pc->SendCmdTick = tick; } else if (tick - pc->SendCmdTick > 500) { //Log("Send Validation Data."); pc->SendCmdTick = tick; send(pc->ServerSocket, (char*)pc->ValidBuff, 18, 0); } break; case GWS_SEND_HEARBEAT: if (tick - pc->SendCmdTick > 50) { send(pc->ServerSocket, (char*)&HEARBEAT, 4, 0); if (++pc->ResendCount >= 3) { Log("GW UDP服务器验证成功, tick:%du", tick - pc->RecvTick); pc->ResendCount = 0; pc->SendCmdTick = 0; pc->RecvTick = tick; pc->SendTick = 0; pc->ServerSendTick = 0; pc->pServerSendBuff = NULL; pc->ServerRecvTick = tick; clientList.push_back(pc); ListRemoveAt(tempClientList, i); continue; } else pc->SendCmdTick = tick; } break; default: Log("未知的UDPClient状态:%d", pc->State); break; } ++i; } } void NewGateServer::_ThreadRecv() { int idx = ::InterlockedIncrement(&m_RecvIndex) - 1; vector<GWClientData*> clientList; vector<GWClientData*> tempClientList; GWRecvThreadData *pRecvData = m_RecvThreadData[idx]; fd_set *pSet = CreateFDSet(); timeval time = { 0, 0 }; int scenetick = m_InitData.SceneHearbeatTick; int halfTimeout = min(HEARBEAT_TICK, m_InitData.Timeout >> 1); UINT ping = PING_ID; char *pBuff = (char*)malloc(m_InitData.BuffSize); const int RESEND_SAFE_COUNT = 5; //安全重发次数 const int RESEND_MAX_COUNT = 15; //最大重发次数 const int RESEND_INTERVAL_SETP = 20; //每次重发的间隔毫秒 vector<UINT*> tempList; while (m_bRun) { //1.接收新客户端 //----------------------------------------------------- UINT tick = timeGetTime(); while (pRecvData->NewClientList.HasItem()) { GWClientData *pc = pRecvData->NewClientList.GetItem(); if (InitClientUDP(pc, true) == false) { pc->~GWClientData(); free(pc); } else { pc->State = GWS_CONNECTING; pc->RecvTick = tick; pc->SendTick = 0; //sendtick 设置为0,继续发送心跳,防止UDP丢包 tempClientList.push_back(pc); } } //2.检查连接状态 //----------------------------------------------------- CheckConnectList(pRecvData, tempClientList, clientList, pBuff); //3.检查状态 //----------------------------------------------------- tick = timeGetTime(); FD_ZERO(pSet); for (UINT i = 0; i < clientList.size();) { GWClientData *pc = clientList[i]; bool bTimeOut = int(tick - pc->RecvTick) > m_InitData.Timeout; bool bTimeOut2 = int(tick - pc->ServerRecvTick) > m_InitData.Timeout; if (pc->Removed || bTimeOut || bTimeOut2 || pc->ResendCount > RESEND_MAX_COUNT) { Log("UDP 客户端断开"); RemoveClient(pc, REMOVE_TIMEOUT); ListRemoveAt(clientList, i); ::InterlockedDecrement(&pRecvData->OnlineNum); continue; } FD_ADD(pc->Socket, pSet); FD_ADD(pc->ServerSocket, pSet); ++i; } //3.接收数据 //----------------------------------------------------- if (FD_COUNT(pSet) == 0) goto SLEEP; int nRet = select(0, pSet, NULL, NULL, &time); tick = timeGetTime(); for (uint i = 0; i < clientList.size(); ++i) { GWClientData *pc = clientList[i]; //服务器端 //=========================================== while (1) { if (FD_ISSET(pc->ServerSocket, pSet)) { int nSize = recv(pc->ServerSocket, pBuff, m_InitData.BuffSize, 0); if (nSize > 0) { RecvDataByUDPServer(pc, pBuff, nSize, tick); pc->ServerRecvTick = tick; } } UINT interval = tick - pc->ServerSendTick; if (interval < UDP_MIN_INTERVAL) break; if (pc->ServerResendCount > RESEND_SAFE_COUNT) { UINT resendInterval = RESEND_INTERVAL_SETP << (pc->ServerResendCount - RESEND_SAFE_COUNT); if (interval < resendInterval) break; } //1.是否有正在发送的数据 if (pc->pServerSendBuff != null) { if (tick - pc->ServerSendCmdTick > UDP_RESEND_TICK || pc->bServerSendBackID) { *pc->pServerSendBuff = SET_ANSWER(pc->ServerRecvID); pc->ServerSendTick = tick; if (send(pc->ServerSocket, (char*)pc->pServerSendBuff, pc->ServerSendSize, 0) == pc->ServerSendSize) pc->bServerSendBackID = false; } } else if (pc->RecvClientList.HasItem()) { pc->pServerSendBuff = pc->RecvClientList.GetItem(); pc->pServerSendBuff[0] = SET_ANSWER(pc->ServerRecvID); pc->pServerSendBuff[1] = ++pc->ServerSendID; pc->ServerSendSize = ((NetCmd*)(pc->pServerSendBuff + 2))->GetCmdSize() + sizeof(UINT)* 2; pc->ServerSendTick = tick; if (send(pc->ServerSocket, (char*)pc->pServerSendBuff, pc->ServerSendSize, 0) == pc->ServerSendSize) { pc->bServerSendBackID = false; pc->ServerSendCmdTick = tick; } else pc->ServerSendCmdTick = 0; } else if (pc->bServerSendBackID || (tick - pc->ServerSendTick > HEARBEAT_TICK)) { UINT backID = SET_ANSWER(pc->ServerRecvID); pc->ServerSendTick = tick; int ret = send(pc->ServerSocket, (char*)&backID, 4, 0); if (ret == 4) { pc->bServerSendBackID = false; } } break; } //客户端 //=========================================== while (1) { if (FD_ISSET(pc->Socket, pSet)) { int nSize = recv(pc->Socket, pBuff, m_InitData.BuffSize, 0); if (nSize > 0) { RecvDataByUDP(pc, pBuff, nSize, tick); pc->RecvTick = tick; } } UINT interval = tick - pc->SendTick; if (interval < UDP_MIN_INTERVAL) break; if (pc->ResendCount > RESEND_SAFE_COUNT) { UINT resendInterval = RESEND_INTERVAL_SETP << (pc->ResendCount - RESEND_SAFE_COUNT); if (interval < resendInterval) break; } //1.是否有正在发送的数据 if (pc->SendSize != 0) { if (tick - pc->SendCmdTick > UDP_RESEND_TICK) { ++pc->ResendCount; SendCmdData(pc, true, tick, tempList); } else if (pc->bSendBackID) { SendCmdData(pc, true, tick, tempList); } } else if (pc->RecvServerList.HasItem()) { SendCmdData(pc, false, tick, tempList); } else if (pc->bSendBackID) { SendBackID(pc, tick); } else { int timeout = pc->InnerIsInScene ? scenetick : halfTimeout; if (int(tick - pc->SendTick) > timeout) { SendBackID(pc, tick);//发送recvid,取代心跳 } } break; } }// end for SLEEP: Sleep(m_InitData.SleepTime); } free(pBuff); DeleteFDSet(pSet); ::InterlockedIncrement(&m_ExitIndex); } bool NewGateServer::Kick(ServerClientData *pClient, RemoveType rt) { RemoveClient((GWClientData*)pClient, rt); return true; } void NewGateServer::Shutdown() { m_bRun = false; //PostQueuedCompletionStatus(m_Handle, 0, NULL, NULL); int count = m_InitData.RecvThreadNum + 1; while (m_ExitIndex != count) Sleep(100); } void NewGateServer::SetCmdHandler(INetHandler *pHandler) { m_pHandler = pHandler; } bool NewGateServer::Send(ServerClientData *pClient, NetCmd *pCmd) { return true; } bool NewGateServer::AddNewClient(void *pData) { AcceptUDPClient *data = (AcceptUDPClient*)pData; USHORT recvIdx; GetRecvIndex(recvIdx); if (recvIdx == USHRT_MAX) { Log("没有适合的空间加入新玩家:%d", recvIdx); return false; } //成功 UINT size = sizeof(GWClientData)+UDP_BUFF_SIZE; GWClientData *pc = new(malloc(size))GWClientData(8, m_InitData.MaxRecvCmdCount, m_InitData.MaxSendCmdCount); pc->Removed = false; pc->RemoveCode = REMOVE_NONE; pc->IsInScene = false; pc->Socket = data->NewSocket; pc->IP = data->ClientAddr.sin_addr.S_un.S_addr; pc->Port = ntohs(data->ClientAddr.sin_port); //char xx[100]; //GetIPString(pc->IP, pc->Port, xx); //Log("ClientIP:%s", xx); pc->ConnectServerIP = data->ServerIP; pc->ConnectServerPort = data->ServerPort; pc->OutsideExtraData = NULL; pc->SendID = 1; pc->RecvID = 1; pc->SendTick = 0; pc->SendCmdTick = 0; pc->ResendCount = 0; pc->bSendBackID = false; pc->SendSize = 0; pc->pSendBuff = NULL; pc->SendError = 0; //------------------------------- pc->ServerResendCount = 0; pc->ServerSendID = 1; pc->ServerSendTick = 0; pc->ServerSendCmdTick = 0; pc->ServerRecvID = 1; pc->ServerRecvTick = 0; pc->ServerSendSize = 0; pc->ServerSendError = 0; pc->bServerSendBackID = false; pc->pServerSendBuff = NULL; m_pHandler->NewClient(m_InitData.ServerID, pc, NULL, 0); GWRecvThreadData *precv = m_RecvThreadData[recvIdx]; //::InterlockedIncrement(&m_OnlineNum); ::InterlockedIncrement(&precv->OnlineNum); precv->NewClientList.AddItem(pc); return true; } void NewGateServer::_ThreadAccept() { SOCKADDR_IN addr; INT addrSize = sizeof(addr); UINT idx = 0; vector<AcceptUDPClient> newList; CreateSocketData csd; UINT data[4]; UINT CONNECT_OK = SERVER_CONNECT_MAGIC; const UINT timeout = 4000; const UINT MaxSendCount = 5; UINT hearbeat = HEARBEAT_ID; char buff[512]; while (m_bRun) { UINT tick = timeGetTime(); for (UINT i = 0; i < m_InitData.MaxAcceptNumPerFrame; ++i) { SOCKET s = accept(m_Socket, (sockaddr*)&addr, &addrSize); if (s == INVALID_SOCKET) break; InitSocket(s, m_InitData.SocketSendSize, m_InitData.SocketRecvSize, true); if (!CreateSocket(CST_UDP | CST_BIND, 0, m_InitData.SocketSendSize, m_InitData.SocketRecvSize, csd)) { Log("创建新的Socket失败, LastErrCode:%u", WSAGetLastError()); continue; } AcceptUDPClient ndc; ndc.ClientAddr = addr; ndc.ClientSocket = s; ndc.NewPort = csd.Port; ndc.NewSocket = csd.Socket; ndc.Tick = tick; ndc.Rand1 = (RandUInt()); ndc.Rand2 = (RandUInt()); ndc.SendCount = 1; ndc.Removed = false; ndc.SendTick = tick; data[0] = CONNECT_OK; data[1] = ndc.Rand1; data[2] = ndc.Rand2; data[3] = ndc.NewPort; //InnerGetIPString(addr, buff); //Log("Socket:%d, Port:%d, clientIP:%s", ndc.NewSocket, ndc.NewPort ,buff); if (send(s, (char*)data, sizeof(data), 0) != sizeof(data)) ndc.SendType = SEND_NONE; else ndc.SendType = SEND_WAIT_NEWPORT; newList.push_back(ndc); } for (UINT i = 0; i < newList.size();) { tick = timeGetTime(); AcceptUDPClient &nc = newList[i]; if (tick - nc.Tick > timeout) { InnerGetIPString(nc.ClientAddr, buff); nc.Removed = true; const char *pc = NULL; if (nc.SendType == SEND_NONE) pc = "SEND_NONE"; else if (nc.SendType == SEND_WAIT_HEARBEAT) pc = "SEND_WAIT_HEARBEAT"; else if (nc.SendType == SEND_WAIT_NEWPORT) pc = "SEND_WAIT_NEWPORT"; else pc = "SEND_UNKNOWN"; Log("UDP验证:超时:%s, 状态:%s, Timeout:%u", buff, pc, tick - nc.Tick); } if (nc.Removed) { //Log("Removed:%d, count:%d", i, newList.size()); if (nc.ClientSocket != NULL) closesocket(nc.ClientSocket); if (nc.NewSocket != NULL) closesocket(nc.NewSocket); ListRemoveAt(newList, i); continue; } ++i; if (nc.SendType == SEND_NONE) { if (tick - nc.SendTick > UDP_VALIDATION_TICK) { nc.SendTick = tick; data[0] = CONNECT_OK; data[1] = nc.Rand1; data[2] = nc.Rand2; data[3] = nc.NewPort; int ret = ::send(nc.ClientSocket, (char*)data, sizeof(data), 0); if (ret == sizeof(data)) { nc.SendType = SEND_WAIT_NEWPORT; nc.SendCount = 0; } else { if (++nc.SendCount > MaxSendCount) { InnerGetIPString(nc.ClientAddr, buff); Log("UDP验证:发送新端口超量,IP:%s, LastErrCode:%u", buff, WSAGetLastError()); nc.Removed = true; } } } } else if (nc.SendType == SEND_WAIT_NEWPORT) { //等待接收验证数据 int ret = recvfrom(nc.NewSocket, buff, sizeof(buff), 0, (sockaddr*)&addr, &addrSize); if (ret == 18) //12个字节的验证 + 6字节的服务器IP { UINT *pRecvID = (UINT*)buff; if (*pRecvID == UDP_VALIDATION_ID && *(pRecvID + 1) == (nc.Rand1 | 0xc0000000) && *(pRecvID + 2) == (nc.Rand2 | 0xc0000000)) { int ret = connect(nc.NewSocket, (sockaddr*)&addr, addrSize); if (ret != 0) { InnerGetIPString(nc.ClientAddr, buff); Log("UDP验证:连接到客户端失败, IP:%s, LastErrCode:%d", buff, WSAGetLastError()); nc.Removed = true; } else { //Log("验证成功."); nc.ClientAddr = addr; //nc.Tick = tick; nc.SendType = SEND_WAIT_HEARBEAT; nc.SendTick = tick; nc.ServerIP = *(pRecvID + 3); nc.ServerPort = *((USHORT*)(pRecvID + 4)); //发送一个心跳给客户端 int ret = send(nc.NewSocket, (char*)&hearbeat, 4, 0); if (ret == sizeof(hearbeat)) nc.SendCount = 1; else nc.SendCount = 0; } } else { nc.Removed = true; char xxx[50]; InnerGetIPString(nc.ClientAddr, xxx); Log("UDP验证:%u, Rand不正确:%u, %u vs %u, %u, IP:%s", *pRecvID, *(pRecvID + 1), *(pRecvID + 2), (nc.Rand1 | 0xc0000000), (nc.Rand2 | 0xc0000000), xxx); } } else if (ret > 0) { nc.Removed = true; InnerGetIPString(nc.ClientAddr, buff); Log("UDP验证:接收长度不正确:%d, IP:%s", ret, buff); } } else if (nc.SendType == SEND_WAIT_HEARBEAT) { //等待接收心跳 int ret = recv(nc.NewSocket, buff, sizeof(buff), 0); if (ret == 4 && *((UINT*)buff) == HEARBEAT_ID) { //成功 if (AddNewClient(&nc)) { //Log("UDP验证成功, Timeout:%d", tick - nc.Tick); nc.NewSocket = NULL; nc.Removed = true; } else { Log("UDP验证加入线程失败."); nc.Removed = true; } } else { if (tick - nc.SendTick > UDP_VALIDATION_TICK) { nc.SendTick = tick; int ret = send(nc.NewSocket, (char*)&hearbeat, 4, 0); if (ret != 4) { InnerGetIPString(nc.ClientAddr, buff); Log("UDP验证:发送心跳失败,IP:%s, SendRet:%d, LastErrCode:%u", buff, ret, WSAGetLastError()); } } } } else { Log("UDP验证:未知的状态:%d", nc.SendType); nc.Removed = true; } }// end for Sleep(m_InitData.SleepTime); } ::InterlockedIncrement(&m_ExitIndex); } UINT NewGateServer::JoinNum()const { return m_OnlineNum; } void NewGateServer::SwitchAccept(bool bEnable) { if (m_bAccept != bEnable) { m_bAccept = bEnable; } } void NewGateServer::RemoveClient(GWClientData *pc, RemoveType rt) { pc->Removed = true; if (pc->RemoveCode == REMOVE_NONE) pc->RemoveCode = rt; closesocket(pc->ServerSocket); closesocket(pc->Socket); m_pHandler->Disconnect(m_InitData.ServerID, pc, pc->RemoveCode); while (pc->RecvServerList.HasItem()) { free(pc->RecvServerList.GetItem()); } while (pc->RecvClientList.HasItem()) { free(pc->RecvClientList.GetItem()); } pc->~GWClientData(); free(pc); //::InterlockedDecrement(&m_OnlineNum); } void NewGateServer::_ThreadLogonAccept() { SOCKADDR_IN addr; INT addrSize = sizeof(addr); UINT idx = 0; char buff[128]; SOCKET logonSocket = m_LogonSocket; while (m_bRun) { for (UINT i = 0; i < m_InitData.LogonAcceptPerFrame; ++i) { SOCKET s = accept(logonSocket, (sockaddr*)&addr, &addrSize); if (s == INVALID_SOCKET) break; InitSocket(s, m_InitData.SocketSendSize, m_InitData.SocketRecvSize, true); UINT n = ++idx % m_InitData.LogonThreadNum; if (m_LogonThreadData[n]->NewClientList.HasSpace() == false) { closesocket(s); Log("TCP验证:加入登录服务器失败,空间不够."); } else { GWNewLogonClient *pc = new GWNewLogonClient(m_InitData.BuffSize); pc->ClientSocket = s; InnerGetIPString(addr, buff); Log("TCP验证:新的登录客户端加入:%s", buff); m_LogonThreadData[n]->NewClientList.AddItem(pc); } } Sleep(m_InitData.SleepTime); } ::InterlockedIncrement(&m_ExitIndex); } bool NewGateServer::TCPRecvServerCmd(GWNewLogonClient *pc) { while (pc->ServerRecvSize >= sizeof(UINT)) { BYTE *pBuff = (BYTE*)(pc->pServerBuff + pc->ServerRecvOffset); UINT recvID = *((UINT*)(pBuff)); if (recvID == HEARBEAT_ID || recvID == PING_ID) { pc->ServerRecvOffset += sizeof(UINT); pc->ServerRecvSize -= sizeof(UINT); } else if (pc->ServerRecvSize >= sizeof(NetCmd)) { NetCmd *pCmdRecv = ((NetCmd*)pBuff); UINT cmdSize = ((NetCmd*)pCmdRecv)->GetCmdSize(); if (cmdSize > m_InitData.BuffSize) { Log(L"RecvServerSize Error:%d", cmdSize); return false; } if (pc->ServerRecvSize >= cmdSize) { NetCmd *pCmd = (NetCmd*)pBuff; if (pCmd->GetCmdType() != m_InitData.CmdHearbeat) { pCmd = CreateCmd(ushort(cmdSize), pBuff); if (pCmd->GetCmdType() == LOGON_SUCCESS_ID) { //登录成功,修改GAME ServerIP; LC_Cmd_AccountOnlyID *pLogonCmd = (LC_Cmd_AccountOnlyID*)pCmd; pLogonCmd->GameIp = pLogonCmd->GateIp; pLogonCmd->GamePort = pLogonCmd->GatePort; pLogonCmd->GateIp = m_LocalIP; pLogonCmd->GatePort = m_InitData.Port; } pc->ServerCmdList.push_back(pCmd); } pc->ServerRecvOffset += cmdSize; pc->ServerRecvSize -= cmdSize; } else break; } else break; } UINT freeBuffSize = m_InitData.BuffSize - (pc->ServerRecvOffset + pc->ServerRecvSize); if (freeBuffSize < 128) { memmove(pc->pServerBuff, pc->pServerBuff + pc->ServerRecvOffset, pc->ServerRecvSize); pc->ServerRecvOffset = 0; } return true; } void NewGateServer::_ThreadLogonRecv() { UINT idx = ::InterlockedIncrement(&m_LogonIndex) - 1; GWLogonThreadData &gtd = *(m_LogonThreadData[idx]); vector<GWNewLogonClient*> client; CreateSocketData csd; FD_SET *pset = CreateFDSet(); UINT timeout = m_InitData.LogonTimeout; SOCKADDR_IN addr; memset(&addr, 0, sizeof(addr)); inet_pton(AF_INET, m_InitData.LogonServerIP, &addr.sin_addr.s_addr); addr.sin_family = AF_INET; addr.sin_port = htons(m_InitData.LogonServerPort); int addrSize = sizeof(addr); timeval time = { 0, 0 }; UINT halftime = 1000; UINT hearbeat = HEARBEAT_ID; while (m_bRun) { UINT tick = timeGetTime(); while (gtd.NewClientList.HasItem()) { GWNewLogonClient *gc = gtd.NewClientList.GetItem(); bool bret = CreateSocket(CST_TCP, 0, m_InitData.SocketRecvSize, m_InitData.SocketSendSize, csd); if (bret == false) { Log("创建TCPSocket 失败"); closesocket(gc->ClientSocket); delete(gc); } else { gc->ServerSocket = csd.Socket; int ret = connect(gc->ServerSocket, (sockaddr*)&addr, addrSize); if (ret != 0 && WSAGetLastError() != 10035) { Log("LogonClient连接到登录服务器失败, IP:%s, port:%d, err:%u", m_InitData.LogonServerIP, m_InitData.LogonServerPort, WSAGetLastError()); closesocket(gc->ClientSocket); delete(gc); } else { gc->RecvTick = tick; gc->SendTick = 0; gc->State = GWS_OK; client.push_back(gc); } } } FD_ZERO(pset); tick = timeGetTime(); for (UINT i = 0; i < client.size();) { GWNewLogonClient *pc = client[i]; if (tick - pc->RecvTick > timeout) { Log("Timeout:%u", tick - pc->RecvTick); pc->State = GWS_REMOVED; } if (pc->State == GWS_REMOVED) { Log("移除客户端."); closesocket(pc->ClientSocket); closesocket(pc->ServerSocket); delete(pc); ListRemoveAt(client, i); continue; } FD_ADD(pc->ClientSocket, pset); FD_ADD(pc->ServerSocket, pset); ++i; } if (FD_COUNT(pset) == 0) goto SLEEP; int nret = select(0, pset, NULL, NULL, &time); tick = timeGetTime(); for (UINT i = 0; i < client.size(); ++i) { GWNewLogonClient *pc = client[i]; //接收数据 if (FD_ISSET(pc->ServerSocket, pset)) { int offset = pc->ServerRecvOffset + pc->ServerRecvSize; int nRet = recv(pc->ServerSocket, pc->pServerBuff + offset, m_InitData.BuffSize - offset, 0); if (nRet == 0 || (nRet == SOCKET_ERROR && (WSAGetLastError() == WSAECONNRESET || WSAGetLastError() == WSAECONNABORTED))) { Log("接收服务器失败."); pc->State = GWS_REMOVED; continue; } if (nRet > 0) { pc->ServerRecvSize += nRet; if (TCPRecvServerCmd(pc) == false) { pc->State = GWS_REMOVED; continue; } } } if (FD_ISSET(pc->ClientSocket, pset)) { int nRet = recv(pc->ClientSocket, pc->pClientBuff + pc->ClientRecvSize, m_InitData.BuffSize - pc->ClientRecvSize, 0); if (nRet == 0 || (nRet == SOCKET_ERROR && (WSAGetLastError() == WSAECONNRESET || WSAGetLastError() == WSAECONNABORTED))) { Log("接收客户端失败."); pc->State = GWS_REMOVED; continue; } if (nRet > 0) { pc->ClientRecvSize += nRet; pc->RecvTick = tick; } } //发送数据 if (pc->ServerCmdList.size() > 0) { NetCmd *pcmd = pc->ServerCmdList.front(); int ret = send(pc->ClientSocket, (char*)pcmd, pcmd->GetCmdSize(), 0); if (ret == pcmd->GetCmdSize()) { pc->ServerCmdList.pop_front(); free(pcmd); } } if (pc->ClientRecvSize > 0) { int ret = send(pc->ServerSocket, pc->pClientBuff, pc->ClientRecvSize, 0); if (ret == pc->ClientRecvSize) { pc->ClientRecvSize = 0; pc->SendTick = tick; } } if (tick - pc->SendTick > halftime) { if (4 == send(pc->ClientSocket, (char*)&hearbeat, 4, 0)) pc->SendTick = tick; } } SLEEP: Sleep(m_InitData.SleepTime); } DeleteFDSet(pset); ::InterlockedIncrement(&m_ExitIndex); } void NewGateServer::_ThreadOperationAccept() { SOCKADDR_IN addr; INT addrSize = sizeof(addr); UINT idx = 0; char buff[128]; SOCKET optSocket = m_OperationSocket; while (m_bRun) { for (UINT i = 0; i < m_InitData.OperationAcceptPerFrame; ++i) { SOCKET s = accept(optSocket, (sockaddr*)&addr, &addrSize); if (s == INVALID_SOCKET) break; InitSocket(s, m_InitData.SocketSendSize, m_InitData.SocketRecvSize, true); if (m_OperationThreadData.NewClientList.HasSpace() == false) { closesocket(s); Log("TCP验证:加入运营服务器失败,空间不够."); } else { GWOperationClient *pc = new GWOperationClient(m_InitData.BuffSize); pc->ClientSocket = s; InnerGetIPString(addr, buff); Log("TCP验证:新的运营客户端加入:%s", buff); m_OperationThreadData.NewClientList.AddItem(pc); } } Sleep(m_InitData.SleepTime); } ::InterlockedIncrement(&m_ExitIndex); } void NewGateServer::_ThreadOperationRecv() { vector<GWOperationClient*> client; CreateSocketData csd; FD_SET *pset = CreateFDSet(); SOCKADDR_IN addr; memset(&addr, 0, sizeof(addr)); inet_pton(AF_INET, m_InitData.OperationServerIP, &addr.sin_addr.s_addr); addr.sin_family = AF_INET; addr.sin_port = htons(m_InitData.OperationServerPort); int addrSize = sizeof(addr); timeval time = { 0, 0 }; UINT halftime = 1000; UINT hearbeat = HEARBEAT_ID; UINT timeout = 5000; //5秒超时 while (m_bRun) { UINT tick = timeGetTime(); while (m_OperationThreadData.NewClientList.HasItem()) { GWOperationClient *gc = m_OperationThreadData.NewClientList.GetItem(); bool bret = CreateSocket(CST_TCP, 0, m_InitData.SocketRecvSize, m_InitData.SocketSendSize, csd); if (bret == false) { Log("创建TCPSocket 失败"); closesocket(gc->ClientSocket); delete(gc); } else { gc->ServerSocket = csd.Socket; int ret = connect(gc->ServerSocket, (sockaddr*)&addr, addrSize); if (ret != 0 && WSAGetLastError() != 10035) { Log("LogonClient连接到运营服务器失败, IP:%s, port:%d, err:%u", m_InitData.OperationServerIP, m_InitData.OperationServerPort, WSAGetLastError()); closesocket(gc->ClientSocket); delete(gc); } else { gc->RecvTick = tick; gc->SendTick = 0; gc->State = GWS_OK; client.push_back(gc); } } } FD_ZERO(pset); tick = timeGetTime(); for (UINT i = 0; i < client.size();) { GWOperationClient *pc = client[i]; if (tick - pc->RecvTick > timeout) { Log("Timeout:%u", tick - pc->RecvTick); pc->State = GWS_REMOVED; } if (pc->State == GWS_REMOVED) { Log("移除客户端."); closesocket(pc->ClientSocket); closesocket(pc->ServerSocket); delete(pc); ListRemoveAt(client, i); continue; } FD_ADD(pc->ClientSocket, pset); FD_ADD(pc->ServerSocket, pset); ++i; } if (FD_COUNT(pset) == 0) goto SLEEP; int nret = select(0, pset, NULL, NULL, &time); tick = timeGetTime(); for (UINT i = 0; i < client.size(); ++i) { GWOperationClient *pc = client[i]; //接收数据 if (FD_ISSET(pc->ServerSocket, pset)) { int nRet = recv(pc->ServerSocket, pc->pServerBuff + pc->ServerRecvSize, m_InitData.BuffSize - pc->ServerRecvSize, 0); if (nRet == 0 || (nRet == SOCKET_ERROR && (WSAGetLastError() == WSAECONNRESET || WSAGetLastError() == WSAECONNABORTED))) { Log("接收服务器失败."); pc->State = GWS_REMOVED; continue; } if (nRet > 0) { pc->ServerRecvSize += nRet; } } if (FD_ISSET(pc->ClientSocket, pset)) { int nRet = recv(pc->ClientSocket, pc->pClientBuff + pc->ClientRecvSize, m_InitData.BuffSize - pc->ClientRecvSize, 0); if (nRet == 0 || (nRet == SOCKET_ERROR && (WSAGetLastError() == WSAECONNRESET || WSAGetLastError() == WSAECONNABORTED))) { Log("接收客户端失败."); pc->State = GWS_REMOVED; continue; } if (nRet > 0) { pc->ClientRecvSize += nRet; } } //发送数据 if (pc->ServerRecvSize > 0) { int ret = send(pc->ClientSocket, pc->pServerBuff, pc->ServerRecvSize, 0); if (ret == pc->ServerRecvSize) { pc->ServerRecvSize = 0; } } if (pc->ClientRecvSize > 0) { int ret = send(pc->ServerSocket, pc->pClientBuff, pc->ClientRecvSize, 0); if (ret == pc->ClientRecvSize) { pc->ClientRecvSize = 0; } } } SLEEP: Sleep(m_InitData.SleepTime); } DeleteFDSet(pset); ::InterlockedIncrement(&m_ExitIndex); }
[ "anhuiwangming@163.com" ]
anhuiwangming@163.com
b7840ec2be0bd6215a43d29a41c7aad76f7ab33e
30681dae0ff67c25216c688c1117f77895da8080
/Ch05/ex0525.cpp
1795a50078ef22ec6c477b1bd7a746573fe9a4b6
[]
no_license
deng25/Cpp-Primer-5th
17b3747214cf2a66dbec6662ee3e56e27141bc85
8a6d63eda154eb34eed740fc76980b883173519b
refs/heads/master
2020-12-24T12:40:29.920775
2017-01-07T12:11:01
2017-01-07T12:11:01
72,964,690
0
0
null
null
null
null
UTF-8
C++
false
false
802
cpp
#include <iostream> #include <exception> using std::cin; using std::cout; using std::endl; using std::exception; int main() { int n1, n2; cout << "请输入两个整数:" << endl; while (cin >> n1 >> n2) { try { if (!n2) { throw exception("被除数不能是0!"); } // throw之后,下面这一条语句不会被执行 cout << n1 << '/' << n2 << '=' << n1 / n2 << endl; } catch (exception err) { cout << err.what() << endl; cout << "再试一次?(Y/N)"; char yn; cin >> yn; if (!cin || yn == 'n' || yn == 'N') { break; } } cout << "请输入两个整数:" << endl; } return 0; }
[ "noreply@github.com" ]
noreply@github.com
1d2fbdef4c6585bfc0f293a732934180778151a6
2a0c80d9417f8538080c9c4582b309a660ad17ef
/fileexport.h
09253b0ae95c7f00fa1135c4b4cfad042e8f90cc
[]
no_license
FxMain/ARK
2388c7375d74a20705833e4fbd2414983a326c87
ba6fc3c4ace6ce750d911883f6a4e5efde44c3ef
refs/heads/master
2020-03-28T22:37:45.082689
2018-10-30T13:03:19
2018-10-30T13:03:19
149,245,943
0
0
null
null
null
null
UTF-8
C++
false
false
283
h
#ifndef FILEEXPORT_H #define FILEEXPORT_H #include <QDialog> namespace Ui { class fileexport; } class fileexport : public QDialog { Q_OBJECT public: explicit fileexport(QWidget *parent = 0); ~fileexport(); private: Ui::fileexport *ui; }; #endif // FILEEXPORT_H
[ "1151042346@qq.com" ]
1151042346@qq.com
53b337b5907780d6092a9aaa4cfa0760a9a32ab3
4019d98ce38791a4e145c639d48aef5666a3fd5c
/probs/bzoj1086-tree-divide-blocks-with-vectors.cpp
cf317b4d0cf26197ee365d2f10e8dc8b9be7c9b5
[]
no_license
karin0/problems
c099ded507fabc08d5fe6a234d8938575e9628b7
b60ffaa685bbeb4a21cde518919cdd2749086846
refs/heads/master
2023-02-09T21:55:24.678019
2021-01-08T16:46:54
2021-01-08T16:46:54
null
0
0
null
null
null
null
UTF-8
C++
false
false
984
cpp
#include <cstdio> #include <vector> const int N = 1005; std::vector<int> g[N]; int n, s, bcnt, cent[N], ssz, bel[N], sta[N]; void dfs(int u, int f) { int osz = ssz; for (std::vector<int>::iterator it = g[u].begin(); it != g[u].end(); ++it) { if (*it == f) continue; dfs(*it, u); if (ssz - osz >= s) { ++bcnt; while (ssz != osz) bel[sta[--ssz]] = bcnt; cent[bcnt] = u; } } sta[ssz++] = u; } void make() { dfs(1, 0); while (ssz) bel[sta[--ssz]] = bcnt; } int main() { static int i, u, v; scanf("%d%d", &n, &s); for (i = 1; i < n; ++i) { scanf("%d%d", &u, &v); g[u].push_back(v); g[v].push_back(u); } make(); printf("%d\n", bcnt); for (i = 1; i <= n; ++i) printf("%d ", bel[i]); putchar('\n'); for (i = 1; i <= bcnt; ++i) printf("%d ", cent[i]); putchar('\n'); return 0; }
[ "dredgar065@gmail.com" ]
dredgar065@gmail.com
5f269e81b48fcd04f37fa4dcd13ad8155a1b58cf
d94436dbb76c4dd13d3e27dd254c70a5f5db1935
/src/models/unit_test/model_test.cpp
823abf81a4b544fbdedff543603256ae1e19374a
[ "Apache-2.0" ]
permissive
gutseb/lbann
298a96ac4f406a20cd8e10b10dce688d2ac6ee52
0433bb81133f54d9555849e710e445b37383d2b8
refs/heads/master
2023-09-01T10:25:50.318390
2021-05-28T00:08:01
2021-05-28T00:08:01
null
0
0
null
null
null
null
UTF-8
C++
false
false
5,072
cpp
//////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2014-2019, Lawrence Livermore National Security, LLC. // Produced at the Lawrence Livermore National Laboratory. // Written by the LBANN Research Team (B. Van Essen, et al.) listed in // the CONTRIBUTORS file. <lbann-dev@llnl.gov> // // LLNL-CODE-697807. // All rights reserved. // // This file is part of LBANN: Livermore Big Artificial Neural Network // Toolkit. For details, see http://software.llnl.gov/LBANN or // https://github.com/LLNL/LBANN. // // Licensed under the Apache License, Version 2.0 (the "Licensee"); you // may not use this file except in compliance with the License. You may // obtain a copy of the License at: // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // implied. See the License for the specific language governing // permissions and limitations under the license. //////////////////////////////////////////////////////////////////////////////// #include <catch2/catch.hpp> #include "TestHelpers.hpp" #include "MPITestHelpers.hpp" #include <lbann/base.hpp> #include <lbann/models/directed_acyclic_graph.hpp> #include <lbann/models/model.hpp> #include <lbann/layers/io/input_layer.hpp> #include <lbann/utils/memory.hpp> #include <lbann/utils/serialize.hpp> #include <lbann/proto/factories.hpp> #include <lbann.pb.h> #include <google/protobuf/text_format.h> namespace pb = ::google::protobuf; namespace { // model_prototext string is defined here as a "const std::string". #include "lenet.prototext.inc" auto mock_datareader_metadata() { lbann::DataReaderMetaData md; auto& md_dims = md.data_dims; // This is all that should be needed for this test. md_dims[lbann::data_reader_target_mode::CLASSIFICATION] = {10}; md_dims[lbann::data_reader_target_mode::INPUT] = {1,28,28}; return md; } template <typename T> auto make_model(lbann::lbann_comm& comm) { lbann_data::LbannPB my_proto; if (!pb::TextFormat::ParseFromString(model_prototext, &my_proto)) throw "Parsing protobuf failed."; auto metadata = mock_datareader_metadata(); auto my_model = lbann::proto::construct_model(&comm, -1, my_proto.optimizer(), my_proto.trainer(), my_proto.model()) ; my_model->setup(1UL, metadata); return my_model; } }// namespace <anon> using unit_test::utilities::IsValidPtr; TEST_CASE("Serializing models", "[mpi][model][serialize]") { using DataType = float; auto& comm = unit_test::utilities::current_world_comm(); auto const& g = comm.get_trainer_grid(); lbann::utils::grid_manager mgr(g); std::stringstream ss; std::unique_ptr<lbann::model> model_src_ptr = make_model<DataType>(comm), model_tgt_ptr; #ifdef LBANN_HAS_CEREAL_BINARY_ARCHIVES SECTION("Binary archive") { { cereal::BinaryOutputArchive oarchive(ss); REQUIRE_NOTHROW(oarchive(model_src_ptr)); } { cereal::BinaryInputArchive iarchive(ss); REQUIRE_NOTHROW(iarchive(model_tgt_ptr)); REQUIRE(IsValidPtr(model_tgt_ptr)); } if (IsValidPtr(model_tgt_ptr)) { auto metadata = mock_datareader_metadata(); REQUIRE_NOTHROW(model_tgt_ptr->setup(1UL, metadata)); // if (comm.get_rank_in_world() == 1) // std::cout << model_tgt_ptr->get_description() // << std::endl; } } SECTION("Rooted binary archive") { { lbann::RootedBinaryOutputArchive oarchive(ss, g); REQUIRE_NOTHROW(oarchive(model_src_ptr)); } { lbann::RootedBinaryInputArchive iarchive(ss, g); REQUIRE_NOTHROW(iarchive(model_tgt_ptr)); REQUIRE(IsValidPtr(model_tgt_ptr)); } if (IsValidPtr(model_tgt_ptr)) { auto metadata = mock_datareader_metadata(); REQUIRE_NOTHROW(model_tgt_ptr->setup(1UL, metadata)); // if (comm.get_rank_in_world() == 1) // std::cout << model_tgt_ptr->get_description() // << std::endl; } } #endif // LBANN_HAS_CEREAL_BINARY_ARCHIVES #ifdef LBANN_HAS_CEREAL_XML_ARCHIVES SECTION("XML archive") { { cereal::XMLOutputArchive oarchive(ss); REQUIRE_NOTHROW(oarchive(model_src_ptr)); } { cereal::XMLInputArchive iarchive(ss); REQUIRE_NOTHROW(iarchive(model_tgt_ptr)); REQUIRE(IsValidPtr(model_tgt_ptr)); } } SECTION("Rooted XML archive") { { lbann::RootedXMLOutputArchive oarchive(ss, g); REQUIRE_NOTHROW(oarchive(model_src_ptr)); } //std::cout << ss.str() << std::endl; { lbann::RootedXMLInputArchive iarchive(ss, g); REQUIRE_NOTHROW(iarchive(model_tgt_ptr)); REQUIRE(IsValidPtr(model_tgt_ptr)); } } #endif // LBANN_HAS_CEREAL_XML_ARCHIVES }
[ "noreply@github.com" ]
noreply@github.com
912ae16af53e6a1529d87240a9ee9d3e62816512
02214e152114bdfaa0df67c2405c6c2654610663
/Classes/TerrainTest.h
6ee37492bb68e0816395b714e470a6ed8885f226
[]
no_license
devssx/Game
e7a6222ba672bd837e2b3272226b43f9c68c3bab
c9e250b5f5eeb0cecfefda1027f336c970b1a220
refs/heads/master
2020-03-17T11:14:53.020823
2018-05-27T01:14:39
2018-05-27T01:14:39
133,543,721
0
0
null
null
null
null
UTF-8
C++
false
false
1,918
h
#ifndef TERRAIN_TESH_H #include "3d/CCSprite3D.h" #include "3d/CCTerrain.h" #include "2d/CCCamera.h" #include "2d/CCAction.h" #include "cocos2d.h" class TerrainTestDemo : public cocos2d::Scene { protected: std::string _title; }; class TerrainSimple : public TerrainTestDemo { public: CREATE_FUNC(TerrainSimple); TerrainSimple(); void onTouchesMoved(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event); cocos2d::Terrain* _terrain; protected: cocos2d::Camera* _camera; }; #define PLAYER_STATE_LEFT 0 #define PLAYER_STATE_RIGHT 1 #define PLAYER_STATE_IDLE 2 #define PLAYER_STATE_FORWARD 3 #define PLAYER_STATE_BACKWARD 4 class Player : public cocos2d::Sprite3D { public: static Player * create(const char * file, cocos2d::Camera* cam, cocos2d::Terrain* terrain); virtual bool isDone() const; virtual void update(float dt); void turnLeft(); void turnRight(); void forward(); void backward(); void idle(); cocos2d::Vec3 _targetPos; void updateState(); float _headingAngle; cocos2d::Vec3 _headingAxis; private: cocos2d::Terrain* _terrain; cocos2d::Camera* _cam; int _playerState; }; class TerrainWalkThru : public TerrainTestDemo { public: CREATE_FUNC(TerrainWalkThru); TerrainWalkThru(); void onTouchesBegan(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event); void onTouchesEnd(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event); protected: cocos2d::Camera* _camera; cocos2d::Terrain* _terrain; Player * _player; }; class TerrainWithLightMap : public TerrainTestDemo { public: CREATE_FUNC(TerrainWithLightMap); TerrainWithLightMap(); void onTouchesMoved(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event); protected: cocos2d::Terrain* _terrain; cocos2d::Camera* _camera; }; #endif // !TERRAIN_TESH_H
[ "salomon.sanchez@gameloft.com" ]
salomon.sanchez@gameloft.com
db8dd62eada9875867786236bcf43116b7d93414
e77e62ee038cf826ac5c9283590941946262e563
/Lab/Conway_Game_of_Life/World.h
ab96f5ad0780e38a1bdada59ec8a2e4100630d53
[]
no_license
himkwan01/TszKwan_CSC17C_48942
2d91fe501a7f620159d6b65ca14042af8f4d5ba8
425ca830a2476c9edf8e8551bc31c515e4493c7c
refs/heads/master
2021-01-22T23:16:23.146434
2015-12-19T07:21:56
2015-12-19T07:21:56
41,872,665
0
0
null
null
null
null
UTF-8
C++
false
false
1,522
h
/* * File: world.h * Author: Himkw_000 * * Created on November 2, 2015, 9:33 AM */ #ifndef WORLD_H #define WORLD_H #include <iostream> using namespace std; class World{ public: World(){} World(int, int); int count_neighbour(int,int); int getRow(){return row;} int getCol(){return col;} int getBoard(int i,int j){return board[i][j];} void setBoard(int value, int i, int j){board[i][j]=value;} void print(); void free(); ~World(); private: int row; int col; int **board; }; World::World(int row, int col){ this->row=row; this->col=col; if(row!=0 && col!=0){ board = new int*[row]; for(int i=0;i<row;i++){ board[i] = new int[col]; } //initialize for(int i=0;i<row;i++){ for(int j=0;j<col;j++){ board[i][j]=0; } } } } int World::count_neighbour(int x, int y){ int lx, ly, bx, by; lx=(x-1>-1?x-1:row-1); ly=(y-1>-1?y-1:col-1); bx=(x+1<row?x+1:0); by=(y+1<col?y+1:0); int count=0; count=board[lx][ly]+board[x][ly]+board[bx][ly]+ board[lx][y]+ board[bx][y]+ board[lx][by]+board[x][by]+board[bx][by]; return count; } void World::print(){ for(int i=0;i<row;i++){ for(int j=0;j<col;j++){ cout<<board[i][j]<<" "; } cout<<endl; } } void World::free(){ for(int i=0;i<row;i++){ delete []board[i]; } delete []board; } World::~World(){ if(row*col!=0){ for(int i=0;i<row;i++){ delete []board[i]; } delete []board; } } #endif /* WORLD_H */
[ "himkwanbbq@hotmail.com" ]
himkwanbbq@hotmail.com
3b059cbe7fd057e906dd52f819df477ea365db9e
50cbf2938d82848fbfb7d2f986db3bedc369bfa3
/include/roq/layer.h
588358bf6078be1bf56820c0c33c949cce387b4b
[ "BSD-3-Clause", "MIT", "BSL-1.0", "Apache-2.0" ]
permissive
nika90426/roq-api
19c15c209d4d37de4245e2e3deefb994ca14505a
b9399cfdc059dde125b94c58b071f0b8c0112bb5
refs/heads/master
2023-05-31T05:56:02.666288
2021-06-20T01:46:22
2021-06-20T01:46:22
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,246
h
/* Copyright (c) 2017-2021, Hans Erik Thrane */ /* !!! THIS FILE HAS BEEN AUTO-GENERATED !!! */ #pragma once #include <fmt/chrono.h> #include <chrono> #include <string_view> #include "roq/chrono.h" #include "roq/format.h" #include "roq/literals.h" #include "roq/numbers.h" #include "roq/span.h" #include "roq/string_buffer.h" #include "roq/uuid.h" namespace roq { //! Represents aggregate order book bid/ask information at a given depth struct ROQ_PUBLIC Layer final { double bid_price = NaN; //!< Bid price level double bid_quantity = {}; //!< Total quantity available at bid double ask_price = NaN; //!< Ask price level double ask_quantity = {}; //!< Total quantity available at ask }; } // namespace roq template <> struct fmt::formatter<roq::Layer> : public roq::formatter { template <typename Context> auto format(const roq::Layer &value, Context &context) { using namespace roq::literals; return roq::format_to( context.out(), R"({{)" R"(bid_price={}, )" R"(bid_quantity={}, )" R"(ask_price={}, )" R"(ask_quantity={})" R"(}})"_fmt, value.bid_price, value.bid_quantity, value.ask_price, value.ask_quantity); } };
[ "thraneh@gmail.com" ]
thraneh@gmail.com
e60848713ee512bb3531f6840f52cd41c8fd259e
243b957e05baa9e00d4dce3f0e848153ed299ae0
/src/bo/t_reaction.h
60b6b4a6ae4206e2dcc03a8fa2f25172429b6486
[]
no_license
victor-tr/configurator
1efe0269d10bde315faaccc30151c225f7caa44e
a911627b97ee3630764959300475e09490d83afd
refs/heads/master
2016-09-05T20:57:36.940171
2015-05-22T10:20:19
2015-05-22T10:20:19
36,068,422
0
1
null
null
null
null
UTF-8
C++
false
false
1,177
h
#ifndef T_REACTION_H #define T_REACTION_H class t_Event; class t_BehaviorPreset; class t_Reaction { typedef qx::dao::ptr<t_BehaviorPreset> t_BehaviorPreset_ptr; typedef qx::QxCollection<int, t_BehaviorPreset_ptr> t_BehaviorPresetX; typedef qx::dao::ptr<t_Event> t_Event_ptr; public: t_Reaction() : _id(-1) {} virtual ~t_Reaction() {} static QSharedPointer<QByteArray> fetchToByteArray(); static void insertFromByteArray(QSharedPointer<QByteArray> data, QSqlDatabase *db = 0); int _id; QString _alias; int _performer_type; int _performer_id; int _performer_behavior; QByteArray _valid_states; bool _bReversible; int _reverse_performer_behavior; t_BehaviorPresetX _behavior_preset_list; t_Event_ptr _event; }; QX_REGISTER_PRIMARY_KEY(t_Reaction, int); ARMOR_QX_REGISTER_HPP(t_Reaction, qx::trait::no_base_class_defined, 0); typedef qx::dao::ptr<t_Reaction> t_Reaction_ptr; typedef qx::QxCollection<int, t_Reaction_ptr> t_ReactionX; typedef qx::dao::ptr< t_ReactionX > t_ReactionX_ptr; Q_DECLARE_METATYPE(t_Reaction_ptr); #endif // T_REACTION_H
[ "vic.box.1970@gmail.com" ]
vic.box.1970@gmail.com
887c895b51b5634f9b5fc48537cf51aedac2f93f
8862013eb3dcb6a174c5262f7a048d8316c13662
/chap5/eg-5-5.cpp
bb353b0a81714d6a396298ca65c24894cb304a62
[ "MIT" ]
permissive
mofhu/algorithm-workbook
ee05d707289e8643a7cfa648f5dda6d87eee07fe
e6255fc20fb76d8712ccfc014da0aaae0dd03452
refs/heads/master
2020-04-19T09:11:47.738047
2016-09-11T15:04:14
2016-09-11T15:04:14
66,284,959
0
0
null
null
null
null
UTF-8
C++
false
false
1,257
cpp
#include<iostream> #include<algorithm> #include<set> #include<map> #include<vector> #include<stack> #include<cstdio> using namespace std; typedef set<int> Set; map<Set,int> IDcache; vector<Set> Setcache; int ID (Set x){ if (IDcache.count(x)) return IDcache[x]; Setcache.push_back(x); return IDcache[x] = Setcache.size() - 1; } #define ALL(x) x.begin(), x.end() #define INS(x) inserter(x,x.begin()) stack<int> s; int main(){ int n, kase; cin >> kase; for (int i = 0; i < kase; i++) { cin >> n; for (int i = 0; i < n; i++) { string op; cin >> op; if (op[0] == 'P') s.push(ID(Set())); else if (op[0] == 'D') s.push(s.top()); else { Set x1 = Setcache[s.top()]; s.pop(); Set x2 = Setcache[s.top()]; s.pop(); Set x; if (op[0] == 'U') set_union(ALL(x1), ALL(x2), INS(x)); if (op[0] == 'I') set_intersection(ALL(x1), ALL(x2), INS(x)); if (op[0] == 'A') { x=x2; x.insert(ID(x1)); } s.push(ID(x)); } cout << Setcache[s.top()].size() << endl; } cout << s.size(); cout << "***\n"; } return 0; }
[ "mofrankhu@gmail.com" ]
mofrankhu@gmail.com
8fea5223b1d7b2cdf993ba7209f026608e55ef9b
fa3050f5e5ee850ba39ccb602804c001d9b4dede
/third_party/blink/renderer/core/app_history/app_history.cc
dfb5eda0ac0688e10183050cae46538582a6f120
[ "LGPL-2.0-only", "BSD-2-Clause", "LGPL-2.1-only", "BSD-3-Clause", "Apache-2.0", "LGPL-2.0-or-later", "MIT", "GPL-1.0-or-later", "LicenseRef-scancode-warranty-disclaimer", "GPL-2.0-only", "LicenseRef-scancode-other-copyleft" ]
permissive
wayou/chromium
a64c9df7d9c6190f8f9f730e7f68a998ffcabfc9
f5f51fc460df28cef915df71b4161aaa6b668004
refs/heads/main
2023-06-27T18:09:41.425496
2021-09-08T23:02:28
2021-09-08T23:02:28
404,525,907
1
0
BSD-3-Clause
2021-09-08T23:38:08
2021-09-08T23:38:08
null
UTF-8
C++
false
false
29,353
cc
// Copyright 2021 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "third_party/blink/renderer/core/app_history/app_history.h" #include <memory> #include "third_party/blink/public/web/web_frame_load_type.h" #include "third_party/blink/renderer/bindings/core/v8/script_function.h" #include "third_party/blink/renderer/bindings/core/v8/script_promise.h" #include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h" #include "third_party/blink/renderer/bindings/core/v8/script_value.h" #include "third_party/blink/renderer/bindings/core/v8/v8_app_history_navigate_event_init.h" #include "third_party/blink/renderer/bindings/core/v8/v8_app_history_navigate_options.h" #include "third_party/blink/renderer/bindings/core/v8/v8_app_history_reload_options.h" #include "third_party/blink/renderer/bindings/core/v8/v8_app_history_transition.h" #include "third_party/blink/renderer/bindings/core/v8/v8_app_history_update_current_options.h" #include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h" #include "third_party/blink/renderer/core/app_history/app_history_destination.h" #include "third_party/blink/renderer/core/app_history/app_history_entry.h" #include "third_party/blink/renderer/core/app_history/app_history_navigate_event.h" #include "third_party/blink/renderer/core/dom/abort_signal.h" #include "third_party/blink/renderer/core/dom/dom_exception.h" #include "third_party/blink/renderer/core/events/error_event.h" #include "third_party/blink/renderer/core/frame/history_util.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/html/forms/form_data.h" #include "third_party/blink/renderer/core/html/forms/html_form_element.h" #include "third_party/blink/renderer/core/loader/document_loader.h" #include "third_party/blink/renderer/core/loader/frame_load_request.h" #include "third_party/blink/renderer/platform/wtf/uuid.h" namespace blink { class AppHistoryApiNavigation final : public GarbageCollected<AppHistoryApiNavigation> { public: AppHistoryApiNavigation(ScriptState* script_state, AppHistoryNavigationOptions* options, const String& key, scoped_refptr<SerializedScriptValue> state = nullptr) : info(options->getInfoOr( ScriptValue(script_state->GetIsolate(), v8::Undefined(script_state->GetIsolate())))), serialized_state(std::move(state)), resolver(MakeGarbageCollected<ScriptPromiseResolver>(script_state)), returned_promise(resolver->Promise()), key(key) {} ScriptValue info; scoped_refptr<SerializedScriptValue> serialized_state; Member<ScriptPromiseResolver> resolver; ScriptPromise returned_promise; String key; void Trace(Visitor* visitor) const { visitor->Trace(info); visitor->Trace(resolver); visitor->Trace(returned_promise); } }; class NavigateReaction final : public ScriptFunction { public: enum class ResolveType { kFulfill, kReject }; static void React(ScriptState* script_state, ScriptPromise promise, AppHistoryApiNavigation* navigation, AppHistoryTransition* transition, AbortSignal* signal) { promise.Then(CreateFunction(script_state, navigation, transition, signal, ResolveType::kFulfill), CreateFunction(script_state, navigation, transition, signal, ResolveType::kReject)); } NavigateReaction(ScriptState* script_state, AppHistoryApiNavigation* navigation, AppHistoryTransition* transition, AbortSignal* signal, ResolveType type) : ScriptFunction(script_state), window_(LocalDOMWindow::From(script_state)), navigation_(navigation), transition_(transition), signal_(signal), type_(type) {} void Trace(Visitor* visitor) const final { ScriptFunction::Trace(visitor); visitor->Trace(window_); visitor->Trace(navigation_); visitor->Trace(transition_); visitor->Trace(signal_); } private: static v8::Local<v8::Function> CreateFunction( ScriptState* script_state, AppHistoryApiNavigation* navigation, AppHistoryTransition* transition, AbortSignal* signal, ResolveType type) { return MakeGarbageCollected<NavigateReaction>(script_state, navigation, transition, signal, type) ->BindToV8Function(); } ScriptValue Call(ScriptValue value) final { DCHECK(window_); if (signal_->aborted()) { window_ = nullptr; return ScriptValue(); } AppHistory* app_history = AppHistory::appHistory(*window_); app_history->ongoing_navigation_signal_ = nullptr; if (type_ == ResolveType::kFulfill) { if (navigation_) { navigation_->resolver->Resolve(); app_history->CleanupApiNavigation(*navigation_); } app_history->DispatchEvent( *Event::Create(event_type_names::kNavigatesuccess)); } else { app_history->RejectPromiseAndFireNavigateErrorEvent(navigation_, value); } if (app_history->transition() == transition_) { app_history->transition_ = nullptr; } window_ = nullptr; return ScriptValue(); } Member<LocalDOMWindow> window_; Member<AppHistoryApiNavigation> navigation_; Member<AppHistoryTransition> transition_; Member<AbortSignal> signal_; ResolveType type_; }; const char AppHistory::kSupplementName[] = "AppHistory"; AppHistory* AppHistory::appHistory(LocalDOMWindow& window) { if (!RuntimeEnabledFeatures::AppHistoryEnabled()) return nullptr; auto* app_history = Supplement<LocalDOMWindow>::From<AppHistory>(window); if (!app_history) { app_history = MakeGarbageCollected<AppHistory>(window); Supplement<LocalDOMWindow>::ProvideTo(window, app_history); } return app_history; } AppHistory::AppHistory(LocalDOMWindow& window) : Supplement<LocalDOMWindow>(window) {} void AppHistory::PopulateKeySet() { DCHECK(keys_to_indices_.IsEmpty()); for (wtf_size_t i = 0; i < entries_.size(); i++) keys_to_indices_.insert(entries_[i]->key(), i); } void AppHistory::InitializeForNavigation( HistoryItem& current, const WebVector<WebHistoryItem>& back_entries, const WebVector<WebHistoryItem>& forward_entries) { DCHECK(entries_.IsEmpty()); // Construct |entries_|. Any back entries are inserted, then the current // entry, then any forward entries. entries_.ReserveCapacity(base::checked_cast<wtf_size_t>( back_entries.size() + forward_entries.size() + 1)); for (const auto& entry : back_entries) { entries_.emplace_back( MakeGarbageCollected<AppHistoryEntry>(GetSupplementable(), entry)); } current_index_ = base::checked_cast<wtf_size_t>(back_entries.size()); entries_.emplace_back( MakeGarbageCollected<AppHistoryEntry>(GetSupplementable(), &current)); for (const auto& entry : forward_entries) { entries_.emplace_back( MakeGarbageCollected<AppHistoryEntry>(GetSupplementable(), entry)); } PopulateKeySet(); } void AppHistory::CloneFromPrevious(AppHistory& previous) { DCHECK(entries_.IsEmpty()); entries_.ReserveCapacity(previous.entries_.size()); for (wtf_size_t i = 0; i < previous.entries_.size(); i++) { // It's possible that |old_item| is indirectly holding a reference to // the old Document. Also, it has a bunch of state we don't need for a // non-current entry. Clone a subset of its state to a |new_item|. HistoryItem* old_item = previous.entries_[i]->GetItem(); HistoryItem* new_item = MakeGarbageCollected<HistoryItem>(); new_item->SetItemSequenceNumber(old_item->ItemSequenceNumber()); new_item->SetDocumentSequenceNumber(old_item->DocumentSequenceNumber()); new_item->SetURL(old_item->Url()); new_item->SetAppHistoryKey(old_item->GetAppHistoryKey()); new_item->SetAppHistoryId(old_item->GetAppHistoryId()); new_item->SetAppHistoryState(old_item->GetAppHistoryState()); entries_.emplace_back( MakeGarbageCollected<AppHistoryEntry>(GetSupplementable(), new_item)); } current_index_ = previous.current_index_; PopulateKeySet(); } void AppHistory::UpdateForNavigation(HistoryItem& item, WebFrameLoadType type) { // A same-document navigation (e.g., a document.open()) in a newly created // iframe will try to operate on an empty |entries_|. appHistory considers // this a no-op. if (entries_.IsEmpty()) return; if (type == WebFrameLoadType::kBackForward) { // If this is a same-document back/forward navigation, the new current // entry should already be present in entries_ and its key in // keys_to_indices_. DCHECK(keys_to_indices_.Contains(item.GetAppHistoryKey())); current_index_ = keys_to_indices_.at(item.GetAppHistoryKey()); return; } if (type == WebFrameLoadType::kStandard) { // For a new back/forward entry, truncate any forward entries and prepare to // append. current_index_++; for (wtf_size_t i = current_index_; i < entries_.size(); i++) keys_to_indices_.erase(entries_[i]->key()); entries_.resize(current_index_ + 1); } // current_index_ is now correctly set (for type of // WebFrameLoadType::kReplaceCurrentItem/kReload/kReloadBypassingCache, it // didn't change). Create the new current entry. entries_[current_index_] = MakeGarbageCollected<AppHistoryEntry>(GetSupplementable(), &item); keys_to_indices_.insert(entries_[current_index_]->key(), current_index_); } AppHistoryEntry* AppHistory::current() const { // current_index_ is initialized to -1 and set >= 0 when entries_ is // populated. It will still be negative if the appHistory of an initial empty // document is accessed. return current_index_ >= 0 && GetSupplementable()->GetFrame() ? entries_[current_index_] : nullptr; } HeapVector<Member<AppHistoryEntry>> AppHistory::entries() { return GetSupplementable()->GetFrame() ? entries_ : HeapVector<Member<AppHistoryEntry>>(); } void AppHistory::updateCurrent(AppHistoryUpdateCurrentOptions* options, ExceptionState& exception_state) { AppHistoryEntry* current_entry = current(); if (!current_entry) { exception_state.ThrowDOMException( DOMExceptionCode::kInvalidStateError, "updateCurrent() cannot be called when on the initial about:blank " "Document, or when the Window is detached."); return; } scoped_refptr<SerializedScriptValue> serialized_state = SerializeState(options->state(), exception_state); if (exception_state.HadException()) return; current_entry->GetItem()->SetAppHistoryState(std::move(serialized_state)); } ScriptPromise AppHistory::navigate(ScriptState* script_state, const String& url, AppHistoryNavigateOptions* options, ExceptionState& exception_state) { KURL completed_url(GetSupplementable()->Url(), url); if (!completed_url.IsValid()) { exception_state.ThrowDOMException( DOMExceptionCode::kSyntaxError, "Invalid URL '" + completed_url.GetString() + "'."); return ScriptPromise(); } PerformSharedNavigationChecks(exception_state, "navigate()"); if (exception_state.HadException()) return ScriptPromise(); scoped_refptr<SerializedScriptValue> serialized_state = nullptr; if (options->hasState()) { serialized_state = SerializeState(options->state(), exception_state); if (exception_state.HadException()) return ScriptPromise(); } WebFrameLoadType frame_load_type = options->replace() ? WebFrameLoadType::kReplaceCurrentItem : WebFrameLoadType::kStandard; return PerformNonTraverseNavigation(script_state, completed_url, std::move(serialized_state), options, frame_load_type, exception_state); } ScriptPromise AppHistory::reload(ScriptState* script_state, AppHistoryReloadOptions* options, ExceptionState& exception_state) { PerformSharedNavigationChecks(exception_state, "reload()"); if (exception_state.HadException()) return ScriptPromise(); scoped_refptr<SerializedScriptValue> serialized_state = nullptr; if (options->hasState()) { serialized_state = SerializeState(options->state(), exception_state); if (exception_state.HadException()) return ScriptPromise(); } else if (AppHistoryEntry* current_entry = current()) { serialized_state = current_entry->GetItem()->GetAppHistoryState(); } return PerformNonTraverseNavigation( script_state, GetSupplementable()->Url(), std::move(serialized_state), options, WebFrameLoadType::kReload, exception_state); } ScriptPromise AppHistory::PerformNonTraverseNavigation( ScriptState* script_state, const KURL& url, scoped_refptr<SerializedScriptValue> serialized_state, AppHistoryNavigationOptions* options, WebFrameLoadType frame_load_type, ExceptionState& exception_state) { DCHECK(frame_load_type == WebFrameLoadType::kReplaceCurrentItem || frame_load_type == WebFrameLoadType::kReload || frame_load_type == WebFrameLoadType::kStandard); AppHistoryApiNavigation* navigation = MakeGarbageCollected<AppHistoryApiNavigation>( script_state, options, String(), std::move(serialized_state)); upcoming_non_traversal_navigation_ = navigation; GetSupplementable()->GetFrame()->MaybeLogAdClickNavigation(); FrameLoadRequest request(GetSupplementable(), ResourceRequest(url)); request.SetClientRedirectReason(ClientNavigationReason::kFrameNavigation); GetSupplementable()->GetFrame()->Navigate(request, frame_load_type); // DispatchNavigateEvent() will clear upcoming_non_traversal_navigation_ if we // get that far. If the navigation is blocked before DispatchNavigateEvent() // is called, reject the promise and cleanup here. if (upcoming_non_traversal_navigation_ == navigation) { upcoming_non_traversal_navigation_ = nullptr; exception_state.ThrowDOMException(DOMExceptionCode::kAbortError, "Navigation was aborted"); return ScriptPromise(); } if (navigation->serialized_state) { current()->GetItem()->SetAppHistoryState( std::move(navigation->serialized_state)); } return navigation->returned_promise; } ScriptPromise AppHistory::goTo(ScriptState* script_state, const String& key, AppHistoryNavigationOptions* options, ExceptionState& exception_state) { PerformSharedNavigationChecks(exception_state, "goTo()/back()/forward()"); if (exception_state.HadException()) return ScriptPromise(); if (!keys_to_indices_.Contains(key)) { exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError, "Invalid key"); return ScriptPromise(); } if (key == current()->key()) return ScriptPromise::CastUndefined(script_state); auto previous_navigation = upcoming_traversals_.find(key); if (previous_navigation != upcoming_traversals_.end()) return previous_navigation->value->returned_promise; AppHistoryApiNavigation* ongoing_navigation = MakeGarbageCollected<AppHistoryApiNavigation>(script_state, options, key); upcoming_traversals_.insert(key, ongoing_navigation); AppHistoryEntry* destination = entries_[keys_to_indices_.at(key)]; // TODO(japhet): We will fire the navigate event for same-document navigations // at commit time, but not cross-document. This should probably move to a more // central location if we want to fire the navigate event for cross-document // back-forward navigations in general. if (!destination->sameDocument()) { if (DispatchNavigateEvent( destination->url(), nullptr, NavigateEventType::kCrossDocument, WebFrameLoadType::kBackForward, UserNavigationInvolvement::kNone, nullptr, destination->GetItem()) != AppHistory::DispatchResult::kContinue) { exception_state.ThrowDOMException(DOMExceptionCode::kAbortError, "Navigation was aborted"); return ScriptPromise(); } } GetSupplementable() ->GetFrame() ->GetLocalFrameHostRemote() .NavigateToAppHistoryKey(key, LocalFrame::HasTransientUserActivation( GetSupplementable()->GetFrame())); return ongoing_navigation->returned_promise; } bool AppHistory::canGoBack() const { return GetSupplementable()->GetFrame() && current_index_ > 0; } bool AppHistory::canGoForward() const { return GetSupplementable()->GetFrame() && current_index_ != -1 && static_cast<size_t>(current_index_) < entries_.size() - 1; } ScriptPromise AppHistory::back(ScriptState* script_state, AppHistoryNavigationOptions* options, ExceptionState& exception_state) { if (!canGoBack()) { exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError, "Cannot go back"); return ScriptPromise(); } return goTo(script_state, entries_[current_index_ - 1]->key(), options, exception_state); } ScriptPromise AppHistory::forward(ScriptState* script_state, AppHistoryNavigationOptions* options, ExceptionState& exception_state) { if (!canGoForward()) { exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError, "Cannot go forward"); return ScriptPromise(); } return goTo(script_state, entries_[current_index_ + 1]->key(), options, exception_state); } void AppHistory::PerformSharedNavigationChecks( ExceptionState& exception_state, const String& method_name_for_error_message) { if (!GetSupplementable()->GetFrame()) { exception_state.ThrowDOMException( DOMExceptionCode::kInvalidStateError, method_name_for_error_message + " cannot be called when the Window is detached."); } if (GetSupplementable()->document()->PageDismissalEventBeingDispatched()) { exception_state.ThrowDOMException( DOMExceptionCode::kInvalidStateError, method_name_for_error_message + " cannot be called during unload or beforeunload."); } } scoped_refptr<SerializedScriptValue> AppHistory::SerializeState( const ScriptValue& value, ExceptionState& exception_state) { return SerializedScriptValue::Serialize( GetSupplementable()->GetIsolate(), value.V8Value(), SerializedScriptValue::SerializeOptions( SerializedScriptValue::kForStorage), exception_state); } String DetermineNavigationType(WebFrameLoadType type) { switch (type) { case WebFrameLoadType::kStandard: return "push"; case WebFrameLoadType::kBackForward: return "traverse"; case WebFrameLoadType::kReload: case WebFrameLoadType::kReloadBypassingCache: return "reload"; case WebFrameLoadType::kReplaceCurrentItem: return "replace"; } NOTREACHED(); return String(); } void AppHistory::PromoteUpcomingNavigationToOngoing(const String& key) { DCHECK(!ongoing_navigation_); if (!key.IsNull()) { DCHECK(!upcoming_non_traversal_navigation_); auto iter = upcoming_traversals_.find(key); if (iter != upcoming_traversals_.end()) { ongoing_navigation_ = iter->value; upcoming_traversals_.erase(iter); } } else { ongoing_navigation_ = upcoming_non_traversal_navigation_.Release(); } } AppHistory::DispatchResult AppHistory::DispatchNavigateEvent( const KURL& url, HTMLFormElement* form, NavigateEventType event_type, WebFrameLoadType type, UserNavigationInvolvement involvement, SerializedScriptValue* state_object, HistoryItem* destination_item) { // TODO(japhet): The draft spec says to cancel any ongoing navigate event // before invoking DispatchNavigateEvent(), because not all navigations will // fire a navigate event, but all should abort an ongoing navigate event. // The main case were that would be a problem (browser-initiated back/forward) // is not implemented yet. Move this once it is implemented. InformAboutCanceledNavigation(); const KURL& current_url = GetSupplementable()->Url(); const String& key = destination_item ? destination_item->GetAppHistoryKey() : String(); PromoteUpcomingNavigationToOngoing(key); if (!GetSupplementable()->GetFrame()->Loader().HasLoadedNonEmptyDocument()) { if (ongoing_navigation_) { if (event_type != NavigateEventType::kCrossDocument) ongoing_navigation_->resolver->Resolve(); CleanupApiNavigation(*ongoing_navigation_); } return DispatchResult::kContinue; } auto* script_state = ToScriptStateForMainWorld(GetSupplementable()->GetFrame()); ScriptState::Scope scope(script_state); auto* init = AppHistoryNavigateEventInit::Create(); const String& navigation_type = DetermineNavigationType(type); init->setNavigationType(navigation_type); SerializedScriptValue* destination_state = nullptr; if (destination_item) destination_state = destination_item->GetAppHistoryState(); else if (ongoing_navigation_ && ongoing_navigation_->serialized_state) destination_state = ongoing_navigation_->serialized_state.get(); AppHistoryDestination* destination = MakeGarbageCollected<AppHistoryDestination>( url, event_type != NavigateEventType::kCrossDocument, destination_state); if (type == WebFrameLoadType::kBackForward) { auto iter = keys_to_indices_.find(key); int index = iter == keys_to_indices_.end() ? 0 : iter->value; destination->SetTraverseProperties(key, destination_item->GetAppHistoryId(), index); } init->setDestination(destination); init->setCancelable(involvement != UserNavigationInvolvement::kBrowserUI || type != WebFrameLoadType::kBackForward); init->setCanTransition( CanChangeToUrlForHistoryApi(url, GetSupplementable()->GetSecurityOrigin(), current_url) && (event_type != NavigateEventType::kCrossDocument || type != WebFrameLoadType::kBackForward)); init->setHashChange(event_type == NavigateEventType::kFragment && url != current_url && EqualIgnoringFragmentIdentifier(url, current_url)); init->setUserInitiated(involvement != UserNavigationInvolvement::kNone); if (form && form->Method() == FormSubmission::kPostMethod) { init->setFormData(FormData::Create(form, ASSERT_NO_EXCEPTION)); } if (ongoing_navigation_) init->setInfo(ongoing_navigation_->info); init->setSignal(MakeGarbageCollected<AbortSignal>(GetSupplementable())); auto* navigate_event = AppHistoryNavigateEvent::Create( GetSupplementable(), event_type_names::kNavigate, init); navigate_event->SetUrl(url); DCHECK(!ongoing_navigate_event_); DCHECK(!ongoing_navigation_signal_); ongoing_navigate_event_ = navigate_event; ongoing_navigation_signal_ = navigate_event->signal(); DispatchEvent(*navigate_event); ongoing_navigate_event_ = nullptr; if (navigate_event->defaultPrevented()) { if (!navigate_event->signal()->aborted()) FinalizeWithAbortedNavigationError(script_state, ongoing_navigation_); return DispatchResult::kAbort; } auto promise_list = navigate_event->GetNavigationActionPromisesList(); if (!promise_list.IsEmpty()) { transition_ = MakeGarbageCollected<AppHistoryTransition>(navigation_type, current()); // The spec says that at this point we should either run the URL and history // update steps (for non-traverse cases) or we should do a same-document // history traversal. In our implementation it's easier for the caller to do // a history traversal since it has access to all the info it needs. // TODO(japhet): Figure out how cross-document back-forward should work. if (type != WebFrameLoadType::kBackForward) { GetSupplementable()->document()->Loader()->RunURLAndHistoryUpdateSteps( url, mojom::blink::SameDocumentNavigationType::kAppHistoryTransitionWhile, state_object, type); } } if (!promise_list.IsEmpty() || event_type != NavigateEventType::kCrossDocument) { NavigateReaction::React( script_state, ScriptPromise::All(script_state, promise_list), ongoing_navigation_, transition_, navigate_event->signal()); } else if (ongoing_navigation_) { ongoing_navigation_->serialized_state.reset(); // The spec assumes it's ok to leave a promise permanently unresolved, but // ScriptPromiseResolver requires either resolution or explicit detach. ongoing_navigation_->resolver->Detach(); } return promise_list.IsEmpty() ? DispatchResult::kContinue : DispatchResult::kTransitionWhile; } void AppHistory::InformAboutCanceledNavigation() { if (ongoing_navigation_signal_) { auto* script_state = ToScriptStateForMainWorld(GetSupplementable()->GetFrame()); ScriptState::Scope scope(script_state); FinalizeWithAbortedNavigationError(script_state, ongoing_navigation_); } // If this function is being called as part of frame detach, also cleanup any // upcoming_traversals_. // // This function may be called when a v8 context hasn't been initialized. // upcoming_traversals_ being non-empty requires a v8 context, so check that // so that we don't unnecessarily try to initialize one below. if (!upcoming_traversals_.IsEmpty() && GetSupplementable()->GetFrame() && !GetSupplementable()->GetFrame()->IsAttached()) { auto* script_state = ToScriptStateForMainWorld(GetSupplementable()->GetFrame()); ScriptState::Scope scope(script_state); HeapVector<Member<AppHistoryApiNavigation>> traversals; CopyValuesToVector(upcoming_traversals_, traversals); for (auto& traversal : traversals) FinalizeWithAbortedNavigationError(script_state, traversal); DCHECK(upcoming_traversals_.IsEmpty()); } } void AppHistory::RejectPromiseAndFireNavigateErrorEvent( AppHistoryApiNavigation* navigation, ScriptValue value) { if (navigation) { navigation->resolver->Reject(value); CleanupApiNavigation(*navigation); } auto* isolate = GetSupplementable()->GetIsolate(); v8::Local<v8::Message> message = v8::Exception::CreateMessage(isolate, value.V8Value()); std::unique_ptr<SourceLocation> location = SourceLocation::FromMessage(isolate, message, GetSupplementable()); ErrorEvent* event = ErrorEvent::Create( ToCoreStringWithNullCheck(message->Get()), std::move(location), value, &DOMWrapperWorld::MainWorld()); event->SetType(event_type_names::kNavigateerror); DispatchEvent(*event); } void AppHistory::CleanupApiNavigation(AppHistoryApiNavigation& navigation) { if (&navigation == ongoing_navigation_) { ongoing_navigation_ = nullptr; } else { DCHECK(!navigation.key.IsNull()); DCHECK(upcoming_traversals_.Contains(navigation.key)); upcoming_traversals_.erase(navigation.key); } } void AppHistory::FinalizeWithAbortedNavigationError( ScriptState* script_state, AppHistoryApiNavigation* navigation) { if (ongoing_navigate_event_) { ongoing_navigate_event_->preventDefault(); ongoing_navigate_event_ = nullptr; } if (ongoing_navigation_signal_) { ongoing_navigation_signal_->SignalAbort(); ongoing_navigation_signal_ = nullptr; } if (navigation) navigation->serialized_state.reset(); RejectPromiseAndFireNavigateErrorEvent( navigation, ScriptValue::From(script_state, MakeGarbageCollected<DOMException>( DOMExceptionCode::kAbortError, "Navigation was aborted"))); transition_ = nullptr; } int AppHistory::GetIndexFor(AppHistoryEntry* entry) { const auto& it = keys_to_indices_.find(entry->key()); if (it == keys_to_indices_.end() || entry != entries_[it->value]) return -1; return it->value; } const AtomicString& AppHistory::InterfaceName() const { return event_target_names::kAppHistory; } void AppHistory::Trace(Visitor* visitor) const { EventTargetWithInlineData::Trace(visitor); Supplement<LocalDOMWindow>::Trace(visitor); visitor->Trace(entries_); visitor->Trace(transition_); visitor->Trace(ongoing_navigation_); visitor->Trace(upcoming_traversals_); visitor->Trace(upcoming_non_traversal_navigation_); visitor->Trace(ongoing_navigate_event_); visitor->Trace(ongoing_navigation_signal_); } } // namespace blink
[ "chromium-scoped@luci-project-accounts.iam.gserviceaccount.com" ]
chromium-scoped@luci-project-accounts.iam.gserviceaccount.com
54db0c8c8791255fa9d937c9330c8e566c32b23b
0cdf75765c8f95c3720bda30ed76db1c44fb4314
/textCompare/weiDockWidget.h
901a1b22e2aa7c85819aa14a4c19c2ba68c418bf
[]
no_license
drink-crow/textCompare
91e28d7cf66f011d4eb22f5c713ff9679a9d0919
17421cac9ab96c37ff1a6053dd7e5387dbd228cb
refs/heads/master
2022-02-24T14:42:12.830405
2019-07-23T06:49:59
2019-07-23T06:49:59
198,369,245
0
1
null
null
null
null
GB18030
C++
false
false
1,712
h
#pragma once #include <QtWidgets/QMainWindow> #include "customTitleBar.h" #include "weiTextedit.h" constexpr int originTopMargin = 2; constexpr int tabAddTopMargin = 4; class weiDockWidget : public QDockWidget { Q_OBJECT //friend class weiDockWidget; public: explicit weiDockWidget(QWidget *parent = Q_NULLPTR, QUuid getUid = QUuid::createUuid()); ~weiDockWidget(); //显示打开的文件 void openFile(QString Name); void setTitleTaborNot(bool isTab) { newTitle->setTaborNot(isTab); } void setTitleText(QString title) { newTitle->setTitleText(title); } void setCustomTitle() { this->setTitleBarWidget(newTitle); } void setEmptyTitle() { this->setTitleBarWidget(emptyTitle); } void setTabMargins() { this->vLayout->setContentsMargins(0, originTopMargin +tabAddTopMargin, 0, 0); } void setUntabMargins(){ this->vLayout->setContentsMargins(0, originTopMargin, 0, 0); } void addText(QString t) { this->textEdit->setPlainText(t); } customTitleBar* getNewTitle() const { return newTitle; } customTextEdit* getTextEdit() const { return textEdit->getTextEdit(); } inline QUuid getUid(void) { return uid; } bool getIsClosing() { return isClosing; } signals: // void editClose(QUuid uid); void editClose(QWidget *sender); void showMassage(QString massage); void checktabified(); public slots: void notifyTopLevelChange(); protected: void closeEvent(QCloseEvent * event); private: //控件 QVBoxLayout *vLayout; weiTextedit *textEdit; QWidget *dockWidgetContent; //空标题栏 QWidget *emptyTitle; QWidget *defaultTitle; customTitleBar *newTitle; //GUID QUuid uid; //关闭状态,因为close函数执行完后才返回的,所以添加关闭中的标志 bool isClosing; };
[ "weibaoziisthebest@outlook.com" ]
weibaoziisthebest@outlook.com
58b763c315531d9a5bcb09f9f284990c3a14dbfa
379522feaf4b1780c11b5802b2fedf7eda90fbb9
/cae/main/loop_condition/loop_condition.h
9e85689313cac3608cabcb3a16598c8eaf9831b1
[]
no_license
evil-is-good/primat-projects
2b0896386ac546559b34b3df20f9862e0230fe28
460645fe25605af16ae074d02eeb801c84c92568
refs/heads/master
2023-01-24T04:34:36.063704
2023-01-03T09:38:49
2023-01-03T09:38:49
16,097,398
2
0
null
null
null
null
UTF-8
C++
false
false
759
h
#ifndef LOOP_CONDITION #define LOOP_CONDITION #include "projects/cae/main/point/point.h" namespace prmt { template<int spacedim> class LoopCondition { public: LoopCondition (prmt::Point<spacedim> &w, vec<prmt::Point<spacedim>> &b) : substitutiv(w), substitutable(b) {}; LoopCondition (prmt::Point<spacedim> &w, prmt::Point<spacedim> &b) : substitutiv(w), substitutable(vec<prmt::Point<spacedim>>({b})) {}; prmt::Point<spacedim> substitutiv; vec<prmt::Point<spacedim>> substitutable; private: LoopCondition () {}; }; }; #endif
[ "vlasko.a.f@yandex.ru" ]
vlasko.a.f@yandex.ru
aa74e2c9165b856f9d025ac5cba0d18f2b8e6014
a26575054e41cc73f9eb2603ba0008694a038126
/vts/vm/src/test/vm/jvmti/funcs/GetLocalLong/GetLocalLong0107/GetLocalLong0107.cpp
a7bd1625b46ee40adacb7958638de6accae6eec2
[ "Apache-2.0", "LicenseRef-scancode-generic-cla" ]
permissive
FLORG1/drlvm-vts-bundle
e269ede0e2c41b402315100d7bb830f6c3d8a097
61f0d5a91d2e703d95e669298a84fc18ae9f050d
refs/heads/master
2021-01-17T20:34:24.999958
2015-04-23T18:54:38
2015-04-23T18:54:38
45,146,096
2
0
null
2015-10-28T22:39:44
2015-10-28T22:39:43
null
UTF-8
C++
false
false
3,153
cpp
/* Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /** * @author Valentin Al. Sitnick * @version $Revision: 1.1 $ * */ /* *********************************************************************** */ #include "events.h" #include "utils.h" #include "fake.h" static bool test = false; static bool util = false; static bool flag = false; const char test_case_name[] = "GetLocalLong0107"; /* *********************************************************************** */ JNIEXPORT jint JNICALL Agent_OnLoad(prms_AGENT_ONLOAD) { Callbacks CB; check_AGENT_ONLOAD; jvmtiEvent events[] = { JVMTI_EVENT_EXCEPTION, JVMTI_EVENT_VM_DEATH }; cb_exc; cb_death; return func_for_Agent_OnLoad(vm, options, reserved, &CB, events, sizeof(events)/4, test_case_name, DEBUG_OUT); } /* *********************************************************************** */ void JNICALL callbackException(prms_EXCPT) { if (flag) return; check_EXCPT; jint depth = 0; jint varnum; jint slot = 0; jlong value; jvmtiError result; jvmtiLocalVariableEntry* table; /* * Function separate all other exceptions in all other method */ if (!check_phase_and_method_debug(jvmti_env, method, SPP_LIVE_ONLY, "special_method", DEBUG_OUT)) return; flag = true; util = true; result = jvmti_env->GetLocalVariableTable(method, &varnum, &table); fprintf(stderr, "\tnative: GetLocalVariableTable result = %d (must be zero) \n", result); fprintf(stderr, "\tnative: method ID is %p (must be NON-zero) \n", method); fprintf(stderr, "\tnative: variables number is %d (must be 6) \n", varnum); fprintf(stderr, "\tnative: table is %p (must be NON-zero)\n", table); fflush(stderr); if (result != JVMTI_ERROR_NONE) return; for (int i = 0; i < varnum; i++) if (!strcmp(table[i].name, "_LNG")) slot = table[i].slot; result = jvmti_env->GetLocalLong(create_not_alive_thread(jni_env, jvmti_env), depth, slot, &value); fprintf(stderr, "\tnative: GetLocalLong result = %d (must be JVMTI_ERROR_THREAD_NOT_ALIVE (15)) \n", result); if (result == JVMTI_ERROR_THREAD_NOT_ALIVE) test = true; } void JNICALL callbackVMDeath(prms_VMDEATH) { check_VMDEATH; func_for_callback_VMDeath(jni_env, jvmti_env, test_case_name, test, util); } /* *********************************************************************** */
[ "niklas@therning.org" ]
niklas@therning.org
e0802e67d49c668db0cab3714dc191c752272e60
2c3c7a7c1926a68ca7794a4960c9cb525aa189fc
/QuadTree.inl
6a24ac39418fdb6edf266e0f69d2618b3740ef4e
[]
no_license
StephanoWurttele/rangeQuery
b13070a318377dadd27963d8540c10d8c93b127f
8c8cb389a2fe45ce43fb9f11287933ecf91c5498
refs/heads/main
2023-06-11T14:20:23.946241
2021-07-01T00:23:00
2021-07-01T00:23:00
381,840,895
0
0
null
null
null
null
UTF-8
C++
false
false
5,182
inl
#include "QuadTree.h" #include <memory> #include <iostream> #include <vector> #include <algorithm> namespace utec { namespace spatial { template<typename Node, typename Rectangle, typename Point> QuadTree<Node, Rectangle, Point>::QuadTree(){ this->root=nullptr; } template<typename Node, typename Rectangle, typename Point> void QuadTree<Node, Rectangle, Point>::insert(Point new_point){ std::shared_ptr<Node>& target = search(new_point, this->root); if(target==nullptr){ target=std::make_shared<Node>(new_point); } } template<typename Node, typename Rectangle, typename Point> std::shared_ptr<Node>& QuadTree<Node, Rectangle, Point>::search(Point target, std::shared_ptr<Node>& node){ if(node == nullptr){ return node; //not found } else if(node->get_point() == target){ return node; } auto cur_point = node->get_point(); const int x=0, y=1; if(target.get(x) < cur_point.get(x)){ if(target.get(y) > cur_point.get(y)) return search(target, node->NW()); else return search(target, node->SW()); }else{ if(target.get(y) > cur_point.get(y)) return search(target, node->NE()); else return search(target, node->SE()); } } template<typename Node, typename Rectangle, typename Point> std::shared_ptr<Node> QuadTree<Node, Rectangle, Point>::search(Point target){ return search(target, this->root); } template<typename Node, typename Rectangle, typename Point> bool QuadTree<Node, Rectangle, Point>::containsPoint(Point target, Rectangle region) { const int x=0, y=1; return target.get(x) >= region._min.get(x) && target.get(x) <= region._max.get(x) && target.get(y) >= region._min.get(y) && target.get(y) <= region._max.get(y); } template<typename Node, typename Rectangle, typename Point> std::vector<Point> QuadTree<Node, Rectangle, Point>::range_recursive(std::shared_ptr<Node>& node, Rectangle region){ const int x=0, y=1; std::vector<Point> response = {}; std::vector<Point> temp; if(node == nullptr) return std::vector<Point>(); if(this->containsPoint(node->get_point(), region)){ response = {node->get_point()}; temp = range_recursive(node->NW(), region); response.insert(response.end(), temp.begin(), temp.end()); temp = range_recursive(node->NE(), region); response.insert(response.end(), temp.begin(), temp.end()); temp = range_recursive(node->SW(), region); response.insert(response.end(), temp.begin(), temp.end()); temp = range_recursive(node->SE(), region); response.insert(response.end(), temp.begin(), temp.end()); return response; } else{ if(region._max.get(x) >= node->get_point().get(x) && region._max.get(y) > node->get_point().get(y)){ temp = range_recursive(node->NE(), region); response.insert(response.begin(), temp.begin(), temp.end()); if(region._min.get(x) < node->get_point().get(x)){ temp = range_recursive(node->NW(), region); response.insert(response.begin(), temp.begin(), temp.end()); }else if(region._min.get(y) <= node->get_point().get(y)){ temp = range_recursive(node->SE(), region); response.insert(response.begin(), temp.begin(), temp.end()); } } else if(region._max.get(x) < node->get_point().get(x) && region._max.get(y) > node->get_point().get(y)){ temp = range_recursive(node->NW(), region); response.insert(response.begin(), temp.begin(), temp.end()); if(region._min.get(y) <= node->get_point().get(y)){ temp = range_recursive(node->SW(), region); response.insert(response.begin(), temp.begin(), temp.end()); } } else if(region._min < node->get_point()){ temp = range_recursive(node->SW(), region); response.insert(response.begin(), temp.begin(), temp.end()); if(region._max.get(x) >= node->get_point().get(x)){ temp = range_recursive(node->SE(), region); response.insert(response.begin(), temp.begin(), temp.end()); } } else{ temp = range_recursive(node->SE(), region); response.insert(response.begin(), temp.begin(), temp.end()); } } return response; } template<typename Node, typename Rectangle, typename Point> std::vector<Point> QuadTree<Node, Rectangle, Point>::range(Rectangle region){ // std::vector<Point> temp = range_recursive(this->root, region); // std::sort(temp.begin(), temp.end()); // int count = std::distance(temp.begin(), std::unique(temp.begin(), temp.end())); // std::vector<Point> result; // for(int i = 0; i < count; ++i) // result.push_back(temp[i]); // return result; return range_recursive(this->root, region); } template<typename Node, typename Rectangle, typename Point> Point QuadTree<Node, Rectangle, Point>::nearest_neighbor(Point reference){ // TODO } } //spatial } //utec
[ "stephano.wurttele@utec.edu.pe" ]
stephano.wurttele@utec.edu.pe
3dd56b34ec8e1962adc281d0a354e50c8b110447
b59c97f2cbccff2157bbc2fb957742bae4b8855f
/LQ/p3.cpp
7f2329e0d6bc35a1973644b575036831806b2176
[]
no_license
Yaser-wyx/ACM
bbeab36c0218ceaaa0e1895f7c6b5eea6df76386
d0c784a9605dc697b4ea9d74c5bd141b2822fec3
refs/heads/master
2020-03-09T04:47:30.418231
2018-05-17T10:24:19
2018-05-17T10:24:19
122,565,642
0
0
null
null
null
null
UTF-8
C++
false
false
484
cpp
#include <bits/stdc++.h> using namespace std; /** * Created with IntelliJ Clion. * @author wanyu * @Date: 2018-03-26 * @Time: 10:55 * To change this template use File | Settings | File Templates. * */ int p3() { for (int i = 1; i <= 200; i++) { int sum = 0; for (int j = i; j <= 200; j++) { sum += j; if (sum == 236) { printf("%d", i); return 0; } } } return 0; }
[ "335767798@qq.com" ]
335767798@qq.com
28c9c2899bd94f1ecf434ff123d2d8e0ed28dde4
0fbdba5f4372ddb01bb4ba69ba18ff26a9fb5d5d
/system/qsongitem.h
690275c99b961d85c8b70513921f6d3a7c40ceaf
[]
no_license
dissonancedev/phonograph
fc47f1e0988949d4dbee8dc9fece161ce6708e74
1433407690b790d1896cfee769cfb51aa72f4319
refs/heads/master
2022-09-06T11:20:16.149679
2015-04-15T14:06:10
2015-04-15T14:06:10
null
0
0
null
null
null
null
UTF-8
C++
false
false
197
h
#ifndef QSONGITEM_H #define QSONGITEM_H #include <QTreeWidgetItem> #include "song.h" class QSongItem: public QTreeWidgetItem { public: Song song; QSongItem(); }; #endif // QSONGITEM_H
[ "nparasta@gmail.com" ]
nparasta@gmail.com
cbbcdddfed0d8da3a1a9e8beb29e031ac5ae1f54
3b01a4a148dbc5f8684da8f3283e71e7fa6922c3
/Source/Urho3D/UI/tbUI/tbUISelectDropdown.cpp
6f08b843d10d86e49428b719c675ef320242007d
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
tyrbedarf/Urho3D
bed80f24a621b89591a56330394cf1e6445803b5
cc1fab1f00a50a61b1e4299e86173c7f8c042887
refs/heads/master
2020-04-21T21:02:59.598840
2019-06-23T15:44:02
2019-06-23T15:44:02
169,866,243
2
0
null
2019-02-09T12:46:47
2019-02-09T12:46:46
null
UTF-8
C++
false
false
1,957
cpp
// // Copyright (c) 2014-2015, THUNDERBEAST GAMES LLC All rights reserved // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // #include <TurboBadger/tb_widgets.h> #include <TurboBadger/tb_widgets_common.h> #include <TurboBadger/tb_select.h> #include "tbUI.h" #include "tbUIEvents.h" #include "tbUISelectDropdown.h" using namespace tb; namespace Urho3D { tbUISelectDropdown::tbUISelectDropdown(Context* context, bool createWidget) : tbUIButton(context, false) { if (createWidget) { widget_ = new TBSelectDropdown(); widget_->SetDelegate(this); GetSubsystem<tbUI>()->WrapWidget(this, widget_); } } void tbUISelectDropdown::SetSource(tbUISelectItemSource* source) { if (!widget_) return; ((TBSelectDropdown*)widget_)->SetSource(source ? source->GetTBItemSource() : NULL); } bool tbUISelectDropdown::OnEvent(const tb::TBWidgetEvent &ev) { return tbUIButton::OnEvent(ev); } }
[ "tyr@tyrbedarf.de" ]
tyr@tyrbedarf.de
d1ce2cff748df656c87c1c9193628abe77bd46b9
8c2b2d80a28d8635ae17f18632222a69b1918f81
/src/protected/geo/geolocationutil.h
52f79c8c991829cf918934f19e9e78e84c13766d
[ "MIT" ]
permissive
stein2k/jeepney
3c859175dd72f54741b7e1456e5f1013b1c270a0
e9bb626ee31b0404fc68bdbc1667ffaa12de78d9
refs/heads/master
2020-03-28T12:56:41.058563
2019-04-10T23:46:21
2019-04-10T23:46:21
148,349,762
0
0
null
null
null
null
UTF-8
C++
false
false
593
h
#ifndef __jeepney_protected_geo_geolocationutil_h #define __jeepney_protected_geo_geolocationutil_h #include <napi.h> namespace jeepney { class EllipseVertices : Napi::ObjectWrap<EllipseVertices> { public: static Napi::Object Init(Napi::Env env, Napi::Object exports); static Napi::Object NewInstance(Napi::Env env, Napi::Value arg); EllipseVertices(const Napi::CallbackInfo& info); private: static Napi::FunctionReference constructor; Napi::Value GetVertices(const Napi::CallbackInfo& info); }; } #endif
[ "stein2k@users.noreply.github.com" ]
stein2k@users.noreply.github.com
29fee7809a46b125fe1f8608f1e018e2851235ba
89dedd7f3c7acc81d12e2bcb2e716f9af9e5fa04
/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContext.cpp
f9a6beb9807001540cc2f7fece3ee4ca3abd8c12
[ "LGPL-2.0-or-later", "GPL-1.0-or-later", "MIT", "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer", "LGPL-2.1-only", "GPL-2.0-only", "LGPL-2.0-only", "BSD-2-Clause", "LicenseRef-scancode-other-copyleft", "BSD-3-Clause" ]
permissive
bino7/chromium
8d26f84a1b6e38a73d1b97fea6057c634eff68cb
4666a6bb6fdcb1114afecf77bdaa239d9787b752
refs/heads/master
2022-12-22T14:31:53.913081
2016-09-06T10:05:11
2016-09-06T10:05:11
67,410,510
1
3
BSD-3-Clause
2022-12-17T03:08:52
2016-09-05T10:11:59
null
UTF-8
C++
false
false
6,314
cpp
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "modules/webgl/WebGL2RenderingContext.h" #include "bindings/modules/v8/OffscreenCanvasRenderingContext2DOrWebGLRenderingContextOrWebGL2RenderingContext.h" #include "bindings/modules/v8/RenderingContext.h" #include "core/frame/LocalFrame.h" #include "core/frame/Settings.h" #include "core/loader/FrameLoader.h" #include "core/loader/FrameLoaderClient.h" #include "gpu/command_buffer/client/gles2_interface.h" #include "modules/webgl/EXTColorBufferFloat.h" #include "modules/webgl/EXTDisjointTimerQuery.h" #include "modules/webgl/EXTTextureFilterAnisotropic.h" #include "modules/webgl/OESTextureFloatLinear.h" #include "modules/webgl/WebGLCompressedTextureASTC.h" #include "modules/webgl/WebGLCompressedTextureATC.h" #include "modules/webgl/WebGLCompressedTextureETC1.h" #include "modules/webgl/WebGLCompressedTexturePVRTC.h" #include "modules/webgl/WebGLCompressedTextureS3TC.h" #include "modules/webgl/WebGLContextAttributeHelpers.h" #include "modules/webgl/WebGLContextEvent.h" #include "modules/webgl/WebGLDebugRendererInfo.h" #include "modules/webgl/WebGLDebugShaders.h" #include "modules/webgl/WebGLLoseContext.h" #include "platform/graphics/gpu/DrawingBuffer.h" #include "public/platform/Platform.h" #include "public/platform/WebGraphicsContext3DProvider.h" #include <memory> namespace blink { CanvasRenderingContext* WebGL2RenderingContext::Factory::create(HTMLCanvasElement* canvas, const CanvasContextCreationAttributes& attrs, Document&) { if (!RuntimeEnabledFeatures::unsafeES3APIsEnabled()) { canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcontextcreationerror, false, true, "Creation of WebGL2 contexts disabled.")); return nullptr; } std::unique_ptr<WebGraphicsContext3DProvider> contextProvider(createWebGraphicsContext3DProvider(canvas, attrs, 2)); if (!contextProvider) return nullptr; gpu::gles2::GLES2Interface* gl = contextProvider->contextGL(); std::unique_ptr<Extensions3DUtil> extensionsUtil = Extensions3DUtil::create(gl); if (!extensionsUtil) return nullptr; if (extensionsUtil->supportsExtension("GL_EXT_debug_marker")) { String contextLabel(String::format("WebGL2RenderingContext-%p", contextProvider.get())); gl->PushGroupMarkerEXT(0, contextLabel.ascii().data()); } WebGL2RenderingContext* renderingContext = new WebGL2RenderingContext(canvas, std::move(contextProvider), attrs); if (!renderingContext->drawingBuffer()) { canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcontextcreationerror, false, true, "Could not create a WebGL2 context.")); return nullptr; } renderingContext->initializeNewContext(); renderingContext->registerContextExtensions(); return renderingContext; } void WebGL2RenderingContext::Factory::onError(HTMLCanvasElement* canvas, const String& error) { canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcontextcreationerror, false, true, error)); } WebGL2RenderingContext::WebGL2RenderingContext(HTMLCanvasElement* passedCanvas, std::unique_ptr<WebGraphicsContext3DProvider> contextProvider, const CanvasContextCreationAttributes& requestedAttributes) : WebGL2RenderingContextBase(passedCanvas, std::move(contextProvider), requestedAttributes) { } WebGL2RenderingContext::~WebGL2RenderingContext() { } void WebGL2RenderingContext::setCanvasGetContextResult(RenderingContext& result) { result.setWebGL2RenderingContext(this); } void WebGL2RenderingContext::setOffscreenCanvasGetContextResult(OffscreenRenderingContext& result) { result.setWebGL2RenderingContext(this); } ImageBitmap* WebGL2RenderingContext::transferToImageBitmap(ExceptionState& exceptionState) { NOTIMPLEMENTED(); return nullptr; } void WebGL2RenderingContext::registerContextExtensions() { // Register extensions. registerExtension<EXTColorBufferFloat>(m_extColorBufferFloat); registerExtension<EXTDisjointTimerQuery>(m_extDisjointTimerQuery); registerExtension<EXTTextureFilterAnisotropic>(m_extTextureFilterAnisotropic); registerExtension<OESTextureFloatLinear>(m_oesTextureFloatLinear); registerExtension<WebGLCompressedTextureASTC>(m_webglCompressedTextureASTC); registerExtension<WebGLCompressedTextureATC>(m_webglCompressedTextureATC); registerExtension<WebGLCompressedTextureETC1>(m_webglCompressedTextureETC1); registerExtension<WebGLCompressedTexturePVRTC>(m_webglCompressedTexturePVRTC); registerExtension<WebGLCompressedTextureS3TC>(m_webglCompressedTextureS3TC); registerExtension<WebGLDebugRendererInfo>(m_webglDebugRendererInfo); registerExtension<WebGLDebugShaders>(m_webglDebugShaders); registerExtension<WebGLLoseContext>(m_webglLoseContext); } DEFINE_TRACE(WebGL2RenderingContext) { visitor->trace(m_extColorBufferFloat); visitor->trace(m_extDisjointTimerQuery); visitor->trace(m_extTextureFilterAnisotropic); visitor->trace(m_oesTextureFloatLinear); visitor->trace(m_webglCompressedTextureASTC); visitor->trace(m_webglCompressedTextureATC); visitor->trace(m_webglCompressedTextureETC1); visitor->trace(m_webglCompressedTexturePVRTC); visitor->trace(m_webglCompressedTextureS3TC); visitor->trace(m_webglDebugRendererInfo); visitor->trace(m_webglDebugShaders); visitor->trace(m_webglLoseContext); WebGL2RenderingContextBase::trace(visitor); } DEFINE_TRACE_WRAPPERS(WebGL2RenderingContext) { visitor->traceWrappers(m_extColorBufferFloat); visitor->traceWrappers(m_extDisjointTimerQuery); visitor->traceWrappers(m_extTextureFilterAnisotropic); visitor->traceWrappers(m_oesTextureFloatLinear); visitor->traceWrappers(m_webglCompressedTextureASTC); visitor->traceWrappers(m_webglCompressedTextureATC); visitor->traceWrappers(m_webglCompressedTextureETC1); visitor->traceWrappers(m_webglCompressedTexturePVRTC); visitor->traceWrappers(m_webglCompressedTextureS3TC); visitor->traceWrappers(m_webglDebugRendererInfo); visitor->traceWrappers(m_webglDebugShaders); visitor->traceWrappers(m_webglLoseContext); } } // namespace blink
[ "bino.zh@gmail.com" ]
bino.zh@gmail.com
52db508fd641ea0ead52c51f1a91c07866215c6a
42c2dad35b237a0cf8119683703885e5ccfd4a0f
/SelectDirFrame.h
b0fc47606d7e980d821332ead55bec9396d341c4
[]
no_license
bp666/Qt-CloudMusic
40f9a9a94b114a8ff3fb8ee06300f6733f615480
443909d440ef282ad4ff640ec56883b9bd7355e0
refs/heads/master
2022-03-25T12:31:28.289871
2019-12-22T05:00:34
2019-12-22T05:00:34
111,340,637
3
0
null
null
null
null
UTF-8
C++
false
false
933
h
#ifndef SELECTDIRFRAME_H #define SELECTDIRFRAME_H #include "FramelessAndAutoSize.h" #include <QLabel> #include <QPushButton> #include <QHBoxLayout> #include <QVBoxLayout> #include <QCheckBox> #include <QGroupBox> #include <QListWidget> #include <QListWidgetItem> class SelectDirFrame : public FramelessAndAutoSize { Q_OBJECT public: explicit SelectDirFrame(QWidget *parent = 0); void mousePressEvent(QMouseEvent *); //文件目录列表 QStringList DirList; //获取qcheckbox选择状态 void getCheckedState(); QPushButton *m_ackBtn;//确认按钮 private slots: void slot_addDir(); private: QFrame *m_f1,*m_f2,*m_f3; QLabel *seleLocalDir,*description; QPushButton *m_closeBtn, *m_addDirBtn; QHBoxLayout *f1HLayout, *f3HLayout; QVBoxLayout *f2VLayout, *mainLayout; QListWidget *checkList; }; #endif // SELECTDIRFRAME_H
[ "sbpuse@outlook.com" ]
sbpuse@outlook.com
d166dddedd8fbdb25c1a24a2fe367c9efde0a798
9cd165fb42220d8e6b46b8a494febb6cfd2d3a99
/Level 2/Lecture 8(Linked List 1)/Classes/Pr1_LengthOfLL.cpp
63f4cc7f9d4d9f76e861d751ff95754512cea64d
[]
no_license
Ritesh0722/Coding-Ninjas-Data-Structures-in-CPP
b4b71e81b27ca75043730078eab12a4cbe3b0d7a
e987a70c34097f970b95adf2daf9499407c03388
refs/heads/master
2023-07-16T02:30:52.533834
2021-08-29T10:11:42
2021-08-29T10:11:42
380,097,424
0
0
null
null
null
null
UTF-8
C++
false
false
1,765
cpp
/*** Length of LL For a given singly linked list of integers, find and return its length. Do it using an iterative method. Input format : The first line contains an Integer 't' which denotes the number of test cases or queries to be run. Then the test cases follow. First and the only line of each test case or query contains elements of the singly linked list separated by a single space. Remember/Consider : While specifying the list elements for input, -1 indicates the end of the singly linked list and hence, would never be a list element. Output format : For each test case, print the length of the linked list. Output for every test case will be printed in a separate line. Constraints : 1 <= t <= 10^2 0 <= N <= 10^5 Time Limit: 1 sec Sample Input 1 : 1 3 4 5 2 6 1 9 -1 Sample Output 1 : 7 Sample Input 2 : 2 10 76 39 -3 2 9 -23 9 -1 -1 Sample Output 2 : 8 0 ***/ #include<bits/stdc++.h> using namespace std; //Part of the given code class Node { public: int data; Node *next; Node(int data) { this->data = data; this->next = NULL; } }; //function to find the length of the Linked List int length(Node *head) { //Write your code here int count = 0; Node *temp = head; while(temp != NULL) { temp = temp -> next; count++; } return count; } //Part of the given code Node *takeinput() { int data; cin >> data; Node *head = NULL, *tail = NULL; while (data != -1) { Node *newNode = new Node(data); if (head == NULL) { head = newNode; tail = newNode; } else { tail->next = newNode; tail = newNode; } cin >> data; } return head; } int main() { int t; cin >> t; while (t--) { Node *head = takeinput(); cout << length(head) << endl; } return 0; }
[ "rnk2217@gmail.com" ]
rnk2217@gmail.com
bffd5c12a5b62d147e4ebc997b18736387eb1b21
6a69d57c782e0b1b993e876ad4ca2927a5f2e863
/vendor/samsung/common/packages/apps/SBrowser/src/chrome/browser/referrer_policy_browsertest.cc
852dfd6862a8321dd88fb28bb0de67fef20b8cc4
[ "BSD-3-Clause" ]
permissive
duki994/G900H-Platform-XXU1BOA7
c8411ef51f5f01defa96b3381f15ea741aa5bce2
4f9307e6ef21893c9a791c96a500dfad36e3b202
refs/heads/master
2020-05-16T20:57:07.585212
2015-05-11T11:03:16
2015-05-11T11:03:16
35,418,464
2
1
null
null
null
null
UTF-8
C++
false
false
24,686
cc
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/bind.h" #include "base/prefs/pref_service.h" #include "base/strings/string_number_conversions.h" #include "base/strings/utf_string_conversions.h" #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/tab_contents/render_view_context_menu.h" #include "chrome/browser/tab_contents/render_view_context_menu_browsertest_util.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_commands.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/common/pref_names.h" #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/ui_test_utils.h" #include "content/public/browser/navigation_controller.h" #include "content/public/browser/navigation_entry.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/web_contents.h" #include "content/public/test/browser_test_utils.h" #include "net/test/spawned_test_server/spawned_test_server.h" #include "third_party/WebKit/public/web/WebInputEvent.h" // GTK requires a X11-level mouse event to open a context menu correctly. #if defined(TOOLKIT_GTK) #define MAYBE_ContextMenuOrigin DISABLED_ContextMenuOrigin #define MAYBE_HttpsContextMenuOrigin DISABLED_HttpsContextMenuOrigin #define MAYBE_ContextMenuRedirect DISABLED_ContextMenuRedirect #define MAYBE_HttpsContextMenuRedirect DISABLED_HttpsContextMenuRedirect #else #define MAYBE_ContextMenuOrigin ContextMenuOrigin #define MAYBE_HttpsContextMenuOrigin HttpsContextMenuOrigin #define MAYBE_ContextMenuRedirect ContextMenuRedirect #define MAYBE_HttpsContextMenuRedirect HttpsContextMenuRedirect #endif namespace { const base::FilePath::CharType kDocRoot[] = FILE_PATH_LITERAL("chrome/test/data/referrer_policy"); } // namespace class ReferrerPolicyTest : public InProcessBrowserTest { public: ReferrerPolicyTest() {} virtual ~ReferrerPolicyTest() {} virtual void SetUp() OVERRIDE { test_server_.reset(new net::SpawnedTestServer( net::SpawnedTestServer::TYPE_HTTP, net::SpawnedTestServer::kLocalhost, base::FilePath(kDocRoot))); ASSERT_TRUE(test_server_->Start()); ssl_test_server_.reset(new net::SpawnedTestServer( net::SpawnedTestServer::TYPE_HTTPS, net::SpawnedTestServer::kLocalhost, base::FilePath(kDocRoot))); ASSERT_TRUE(ssl_test_server_->Start()); InProcessBrowserTest::SetUp(); } protected: enum ExpectedReferrer { EXPECT_EMPTY_REFERRER, EXPECT_FULL_REFERRER, EXPECT_ORIGIN_AS_REFERRER }; // Returns the expected title for the tab with the given (full) referrer and // the expected modification of it. base::string16 GetExpectedTitle(const GURL& url, ExpectedReferrer expected_referrer) { std::string referrer; switch (expected_referrer) { case EXPECT_EMPTY_REFERRER: referrer = "Referrer is empty"; break; case EXPECT_FULL_REFERRER: referrer = "Referrer is " + url.spec(); break; case EXPECT_ORIGIN_AS_REFERRER: referrer = "Referrer is " + url.GetWithEmptyPath().spec(); break; } return base::ASCIIToUTF16(referrer); } // Adds all possible titles to the TitleWatcher, so we don't time out // waiting for the title if the test fails. void AddAllPossibleTitles(const GURL& url, content::TitleWatcher* title_watcher) { title_watcher->AlsoWaitForTitle( GetExpectedTitle(url, EXPECT_EMPTY_REFERRER)); title_watcher->AlsoWaitForTitle( GetExpectedTitle(url, EXPECT_FULL_REFERRER)); title_watcher->AlsoWaitForTitle( GetExpectedTitle(url, EXPECT_ORIGIN_AS_REFERRER)); } // Returns a string representation of a given |referrer_policy|. std::string ReferrerPolicyToString(blink::WebReferrerPolicy referrer_policy) { switch (referrer_policy) { case blink::WebReferrerPolicyDefault: return "default"; case blink::WebReferrerPolicyOrigin: return "origin"; case blink::WebReferrerPolicyAlways: return "always"; case blink::WebReferrerPolicyNever: return "never"; default: NOTREACHED(); return ""; } } enum StartOnProtocol { START_ON_HTTP, START_ON_HTTPS, }; enum LinkType { REGULAR_LINK, LINk_WITH_TARGET_BLANK, }; enum RedirectType { NO_REDIRECT, SERVER_REDIRECT, SERVER_REDIRECT_ON_HTTP, }; std::string RedirectTypeToString(RedirectType redirect) { switch (redirect) { case NO_REDIRECT: return "none"; case SERVER_REDIRECT: return "https"; case SERVER_REDIRECT_ON_HTTP: return "http"; } NOTREACHED(); return ""; } // Navigates from a page with a given |referrer_policy| and checks that the // reported referrer matches the expectation. // Parameters: // referrer_policy: The referrer policy to test. // start_protocol: The protocol the test should start on. // link_type: The link type that is used to trigger the navigation. // redirect: Whether the link target should redirect and how. // disposition: The disposition for the navigation. // button: If not WebMouseEvent::ButtonNone, click on the // link with the specified mouse button. // expected_referrer: The kind of referrer to expect. // // Returns: // The URL of the first page navigated to. GURL RunReferrerTest(const blink::WebReferrerPolicy referrer_policy, StartOnProtocol start_protocol, LinkType link_type, RedirectType redirect, WindowOpenDisposition disposition, blink::WebMouseEvent::Button button, ExpectedReferrer expected_referrer) { GURL start_url; net::SpawnedTestServer* start_server = start_protocol == START_ON_HTTPS ? ssl_test_server_.get() : test_server_.get(); start_url = start_server->GetURL( std::string("files/referrer-policy-start.html?") + "policy=" + ReferrerPolicyToString(referrer_policy) + "&port=" + base::IntToString(test_server_->host_port_pair().port()) + "&ssl_port=" + base::IntToString(ssl_test_server_->host_port_pair().port()) + "&redirect=" + RedirectTypeToString(redirect) + "&link=" + (button == blink::WebMouseEvent::ButtonNone ? "false" : "true") + "&target=" + (link_type == LINk_WITH_TARGET_BLANK ? "_blank" : "")); ui_test_utils::WindowedTabAddedNotificationObserver tab_added_observer( content::NotificationService::AllSources()); base::string16 expected_title = GetExpectedTitle(start_url, expected_referrer); content::WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); content::TitleWatcher title_watcher(tab, expected_title); // Watch for all possible outcomes to avoid timeouts if something breaks. AddAllPossibleTitles(start_url, &title_watcher); ui_test_utils::NavigateToURL(browser(), start_url); if (button != blink::WebMouseEvent::ButtonNone) { blink::WebMouseEvent mouse_event; mouse_event.type = blink::WebInputEvent::MouseDown; mouse_event.button = button; mouse_event.x = 15; mouse_event.y = 15; mouse_event.clickCount = 1; tab->GetRenderViewHost()->ForwardMouseEvent(mouse_event); mouse_event.type = blink::WebInputEvent::MouseUp; tab->GetRenderViewHost()->ForwardMouseEvent(mouse_event); } if (disposition == CURRENT_TAB) { EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); } else { tab_added_observer.Wait(); tab = tab_added_observer.GetTab(); EXPECT_TRUE(tab); content::WaitForLoadStop(tab); EXPECT_EQ(expected_title, tab->GetTitle()); } EXPECT_EQ(referrer_policy, tab->GetController().GetActiveEntry()->GetReferrer().policy); return start_url; } scoped_ptr<net::SpawnedTestServer> test_server_; scoped_ptr<net::SpawnedTestServer> ssl_test_server_; }; // The basic behavior of referrer policies is covered by layout tests in // http/tests/security/referrer-policy-*. These tests cover (hopefully) all // code paths chrome uses to navigate. To keep the number of combinations down, // we only test the "origin" policy here. // // Some tests are marked as FAILS, see http://crbug.com/124750 // Content initiated navigation, from HTTP to HTTP. IN_PROC_BROWSER_TEST_F(ReferrerPolicyTest, Origin) { RunReferrerTest(blink::WebReferrerPolicyOrigin, START_ON_HTTP, REGULAR_LINK, NO_REDIRECT, CURRENT_TAB, blink::WebMouseEvent::ButtonNone, EXPECT_ORIGIN_AS_REFERRER); } // Content initiated navigation, from HTTPS to HTTP. IN_PROC_BROWSER_TEST_F(ReferrerPolicyTest, HttpsDefault) { RunReferrerTest(blink::WebReferrerPolicyOrigin, START_ON_HTTPS, REGULAR_LINK, NO_REDIRECT, CURRENT_TAB, blink::WebMouseEvent::ButtonNone, EXPECT_ORIGIN_AS_REFERRER); } // User initiated navigation, from HTTP to HTTP. IN_PROC_BROWSER_TEST_F(ReferrerPolicyTest, LeftClickOrigin) { RunReferrerTest(blink::WebReferrerPolicyOrigin, START_ON_HTTP, REGULAR_LINK, NO_REDIRECT, CURRENT_TAB, blink::WebMouseEvent::ButtonLeft, EXPECT_ORIGIN_AS_REFERRER); } // User initiated navigation, from HTTPS to HTTP. IN_PROC_BROWSER_TEST_F(ReferrerPolicyTest, HttpsLeftClickOrigin) { RunReferrerTest(blink::WebReferrerPolicyOrigin, START_ON_HTTPS, REGULAR_LINK, NO_REDIRECT, CURRENT_TAB, blink::WebMouseEvent::ButtonLeft, EXPECT_ORIGIN_AS_REFERRER); } // User initiated navigation, middle click, from HTTP to HTTP. IN_PROC_BROWSER_TEST_F(ReferrerPolicyTest, MiddleClickOrigin) { RunReferrerTest(blink::WebReferrerPolicyOrigin, START_ON_HTTP, REGULAR_LINK, NO_REDIRECT, NEW_BACKGROUND_TAB, blink::WebMouseEvent::ButtonMiddle, EXPECT_ORIGIN_AS_REFERRER); } // User initiated navigation, middle click, from HTTPS to HTTP. IN_PROC_BROWSER_TEST_F(ReferrerPolicyTest, HttpsMiddleClickOrigin) { RunReferrerTest(blink::WebReferrerPolicyOrigin, START_ON_HTTPS, REGULAR_LINK, NO_REDIRECT, NEW_BACKGROUND_TAB, blink::WebMouseEvent::ButtonMiddle, EXPECT_ORIGIN_AS_REFERRER); } // User initiated navigation, target blank, from HTTP to HTTP. IN_PROC_BROWSER_TEST_F(ReferrerPolicyTest, TargetBlankOrigin) { RunReferrerTest(blink::WebReferrerPolicyOrigin, START_ON_HTTP, LINk_WITH_TARGET_BLANK, NO_REDIRECT, NEW_FOREGROUND_TAB, blink::WebMouseEvent::ButtonLeft, EXPECT_ORIGIN_AS_REFERRER); } // User initiated navigation, target blank, from HTTPS to HTTP. IN_PROC_BROWSER_TEST_F(ReferrerPolicyTest, HttpsTargetBlankOrigin) { RunReferrerTest(blink::WebReferrerPolicyOrigin, START_ON_HTTPS, LINk_WITH_TARGET_BLANK, NO_REDIRECT, NEW_FOREGROUND_TAB, blink::WebMouseEvent::ButtonLeft, EXPECT_ORIGIN_AS_REFERRER); } // User initiated navigation, middle click, target blank, from HTTP to HTTP. IN_PROC_BROWSER_TEST_F(ReferrerPolicyTest, MiddleClickTargetBlankOrigin) { RunReferrerTest(blink::WebReferrerPolicyOrigin, START_ON_HTTP, LINk_WITH_TARGET_BLANK, NO_REDIRECT, NEW_FOREGROUND_TAB, blink::WebMouseEvent::ButtonMiddle, EXPECT_ORIGIN_AS_REFERRER); } // User initiated navigation, middle click, target blank, from HTTPS to HTTP. IN_PROC_BROWSER_TEST_F(ReferrerPolicyTest, HttpsMiddleClickTargetBlankOrigin) { RunReferrerTest(blink::WebReferrerPolicyOrigin, START_ON_HTTPS, LINk_WITH_TARGET_BLANK, NO_REDIRECT, NEW_FOREGROUND_TAB, blink::WebMouseEvent::ButtonMiddle, EXPECT_ORIGIN_AS_REFERRER); } // Context menu, from HTTP to HTTP. IN_PROC_BROWSER_TEST_F(ReferrerPolicyTest, MAYBE_ContextMenuOrigin) { ContextMenuNotificationObserver context_menu_observer( IDC_CONTENT_CONTEXT_OPENLINKNEWTAB); RunReferrerTest(blink::WebReferrerPolicyOrigin, START_ON_HTTP, REGULAR_LINK, NO_REDIRECT, NEW_FOREGROUND_TAB, blink::WebMouseEvent::ButtonRight, EXPECT_ORIGIN_AS_REFERRER); } // Context menu, from HTTPS to HTTP. IN_PROC_BROWSER_TEST_F(ReferrerPolicyTest, MAYBE_HttpsContextMenuOrigin) { ContextMenuNotificationObserver context_menu_observer( IDC_CONTENT_CONTEXT_OPENLINKNEWTAB); RunReferrerTest(blink::WebReferrerPolicyOrigin, START_ON_HTTPS, REGULAR_LINK, NO_REDIRECT, NEW_FOREGROUND_TAB, blink::WebMouseEvent::ButtonRight, EXPECT_ORIGIN_AS_REFERRER); } // Content initiated navigation, from HTTP to HTTP via server redirect. IN_PROC_BROWSER_TEST_F(ReferrerPolicyTest, Redirect) { RunReferrerTest(blink::WebReferrerPolicyOrigin, START_ON_HTTP, REGULAR_LINK, SERVER_REDIRECT, CURRENT_TAB, blink::WebMouseEvent::ButtonNone, EXPECT_ORIGIN_AS_REFERRER); } // Content initiated navigation, from HTTPS to HTTP via server redirect. IN_PROC_BROWSER_TEST_F(ReferrerPolicyTest, HttpsRedirect) { RunReferrerTest(blink::WebReferrerPolicyOrigin, START_ON_HTTPS, REGULAR_LINK, SERVER_REDIRECT, CURRENT_TAB, blink::WebMouseEvent::ButtonNone, EXPECT_ORIGIN_AS_REFERRER); } // User initiated navigation, from HTTP to HTTP via server redirect. IN_PROC_BROWSER_TEST_F(ReferrerPolicyTest, LeftClickRedirect) { RunReferrerTest(blink::WebReferrerPolicyOrigin, START_ON_HTTP, REGULAR_LINK, SERVER_REDIRECT, CURRENT_TAB, blink::WebMouseEvent::ButtonLeft, EXPECT_ORIGIN_AS_REFERRER); } // User initiated navigation, from HTTPS to HTTP via server redirect. IN_PROC_BROWSER_TEST_F(ReferrerPolicyTest, HttpsLeftClickRedirect) { RunReferrerTest(blink::WebReferrerPolicyOrigin, START_ON_HTTPS, REGULAR_LINK, SERVER_REDIRECT, CURRENT_TAB, blink::WebMouseEvent::ButtonLeft, EXPECT_ORIGIN_AS_REFERRER); } // User initiated navigation, middle click, from HTTP to HTTP via server // redirect. IN_PROC_BROWSER_TEST_F(ReferrerPolicyTest, MiddleClickRedirect) { RunReferrerTest(blink::WebReferrerPolicyOrigin, START_ON_HTTP, REGULAR_LINK, SERVER_REDIRECT, NEW_BACKGROUND_TAB, blink::WebMouseEvent::ButtonMiddle, EXPECT_ORIGIN_AS_REFERRER); } // User initiated navigation, middle click, from HTTPS to HTTP via server // redirect. IN_PROC_BROWSER_TEST_F(ReferrerPolicyTest, HttpsMiddleClickRedirect) { RunReferrerTest(blink::WebReferrerPolicyOrigin, START_ON_HTTPS, REGULAR_LINK, SERVER_REDIRECT, NEW_BACKGROUND_TAB, blink::WebMouseEvent::ButtonMiddle, EXPECT_ORIGIN_AS_REFERRER); } // User initiated navigation, target blank, from HTTP to HTTP via server // redirect. IN_PROC_BROWSER_TEST_F(ReferrerPolicyTest, TargetBlankRedirect) { RunReferrerTest(blink::WebReferrerPolicyOrigin, START_ON_HTTP, LINk_WITH_TARGET_BLANK, SERVER_REDIRECT, NEW_FOREGROUND_TAB, blink::WebMouseEvent::ButtonLeft, EXPECT_ORIGIN_AS_REFERRER); } // User initiated navigation, target blank, from HTTPS to HTTP via server // redirect. IN_PROC_BROWSER_TEST_F(ReferrerPolicyTest, HttpsTargetBlankRedirect) { RunReferrerTest(blink::WebReferrerPolicyOrigin, START_ON_HTTPS, LINk_WITH_TARGET_BLANK, SERVER_REDIRECT, NEW_FOREGROUND_TAB, blink::WebMouseEvent::ButtonLeft, EXPECT_ORIGIN_AS_REFERRER); } // User initiated navigation, middle click, target blank, from HTTP to HTTP via // server redirect. IN_PROC_BROWSER_TEST_F(ReferrerPolicyTest, MiddleClickTargetBlankRedirect) { RunReferrerTest(blink::WebReferrerPolicyOrigin, START_ON_HTTP, LINk_WITH_TARGET_BLANK, SERVER_REDIRECT, NEW_FOREGROUND_TAB, blink::WebMouseEvent::ButtonMiddle, EXPECT_ORIGIN_AS_REFERRER); } // User initiated navigation, middle click, target blank, from HTTPS to HTTP // via server redirect. IN_PROC_BROWSER_TEST_F(ReferrerPolicyTest, HttpsMiddleClickTargetBlankRedirect) { RunReferrerTest(blink::WebReferrerPolicyOrigin, START_ON_HTTPS, LINk_WITH_TARGET_BLANK, SERVER_REDIRECT, NEW_FOREGROUND_TAB, blink::WebMouseEvent::ButtonMiddle, EXPECT_ORIGIN_AS_REFERRER); } // Context menu, from HTTP to HTTP via server redirect. IN_PROC_BROWSER_TEST_F(ReferrerPolicyTest, MAYBE_ContextMenuRedirect) { ContextMenuNotificationObserver context_menu_observer( IDC_CONTENT_CONTEXT_OPENLINKNEWTAB); RunReferrerTest(blink::WebReferrerPolicyOrigin, START_ON_HTTP, REGULAR_LINK, SERVER_REDIRECT, NEW_FOREGROUND_TAB, blink::WebMouseEvent::ButtonRight, EXPECT_ORIGIN_AS_REFERRER); } // Context menu, from HTTPS to HTTP via server redirect. IN_PROC_BROWSER_TEST_F(ReferrerPolicyTest, MAYBE_HttpsContextMenuRedirect) { ContextMenuNotificationObserver context_menu_observer( IDC_CONTENT_CONTEXT_OPENLINKNEWTAB); RunReferrerTest(blink::WebReferrerPolicyOrigin, START_ON_HTTPS, REGULAR_LINK, SERVER_REDIRECT, NEW_FOREGROUND_TAB, blink::WebMouseEvent::ButtonRight, EXPECT_ORIGIN_AS_REFERRER); } // Tests history navigation actions: Navigate from A to B with a referrer // policy, then navigate to C, back to B, and reload. IN_PROC_BROWSER_TEST_F(ReferrerPolicyTest, History) { // Navigate from A to B. GURL start_url = RunReferrerTest(blink::WebReferrerPolicyOrigin, START_ON_HTTPS, REGULAR_LINK, SERVER_REDIRECT, CURRENT_TAB, blink::WebMouseEvent::ButtonLeft, EXPECT_ORIGIN_AS_REFERRER); // Navigate to C. ui_test_utils::NavigateToURL(browser(), test_server_->GetURL(std::string())); base::string16 expected_title = GetExpectedTitle(start_url, EXPECT_ORIGIN_AS_REFERRER); content::WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); scoped_ptr<content::TitleWatcher> title_watcher( new content::TitleWatcher(tab, expected_title)); // Watch for all possible outcomes to avoid timeouts if something breaks. AddAllPossibleTitles(start_url, title_watcher.get()); // Go back to B. chrome::GoBack(browser(), CURRENT_TAB); EXPECT_EQ(expected_title, title_watcher->WaitAndGetTitle()); title_watcher.reset(new content::TitleWatcher(tab, expected_title)); AddAllPossibleTitles(start_url, title_watcher.get()); // Reload to B. chrome::Reload(browser(), CURRENT_TAB); EXPECT_EQ(expected_title, title_watcher->WaitAndGetTitle()); title_watcher.reset(new content::TitleWatcher(tab, expected_title)); AddAllPossibleTitles(start_url, title_watcher.get()); // Shift-reload to B. chrome::ReloadIgnoringCache(browser(), CURRENT_TAB); EXPECT_EQ(expected_title, title_watcher->WaitAndGetTitle()); } // Tests that reloading a site for "request tablet version" correctly clears // the referrer. IN_PROC_BROWSER_TEST_F(ReferrerPolicyTest, RequestTabletSite) { GURL start_url = RunReferrerTest(blink::WebReferrerPolicyOrigin, START_ON_HTTPS, REGULAR_LINK, SERVER_REDIRECT_ON_HTTP, CURRENT_TAB, blink::WebMouseEvent::ButtonLeft, EXPECT_ORIGIN_AS_REFERRER); base::string16 expected_title = GetExpectedTitle(start_url, EXPECT_EMPTY_REFERRER); content::WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); content::TitleWatcher title_watcher(tab, expected_title); // Watch for all possible outcomes to avoid timeouts if something breaks. AddAllPossibleTitles(start_url, &title_watcher); // Request tablet version. chrome::ToggleRequestTabletSite(browser()); EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); } // Test that an iframes gets the parent frames referrer and referrer policy if // the load was triggered by the parent, or from the iframe itself, if the // navigations was started by the iframe. IN_PROC_BROWSER_TEST_F(ReferrerPolicyTest, IFrame) { browser()->profile()->GetPrefs()->SetBoolean( prefs::kWebKitAllowRunningInsecureContent, true); content::WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); base::string16 expected_title(base::ASCIIToUTF16("loaded")); scoped_ptr<content::TitleWatcher> title_watcher( new content::TitleWatcher(tab, expected_title)); // Load a page that loads an iframe. ui_test_utils::NavigateToURL( browser(), ssl_test_server_->GetURL( std::string("files/referrer-policy-iframe.html?") + base::IntToString(test_server_->host_port_pair().port()))); EXPECT_EQ(expected_title, title_watcher->WaitAndGetTitle()); // Verify that the referrer policy was honored and the main page's origin was // send as referrer. std::string title; EXPECT_TRUE(content::ExecuteScriptInFrameAndExtractString( tab, "//iframe", "window.domAutomationController.send(document.title)", &title)); EXPECT_EQ("Referrer is " + ssl_test_server_->GetURL(std::string()).spec(), title); // Reload the iframe. expected_title = base::ASCIIToUTF16("reset"); title_watcher.reset(new content::TitleWatcher(tab, expected_title)); EXPECT_TRUE(content::ExecuteScript(tab, "document.title = 'reset'")); EXPECT_EQ(expected_title, title_watcher->WaitAndGetTitle()); expected_title = base::ASCIIToUTF16("loaded"); title_watcher.reset(new content::TitleWatcher(tab, expected_title)); EXPECT_TRUE( content::ExecuteScriptInFrame(tab, "//iframe", "location.reload()")); EXPECT_EQ(expected_title, title_watcher->WaitAndGetTitle()); // Verify that the full url of the iframe was used as referrer. EXPECT_TRUE(content::ExecuteScriptInFrameAndExtractString( tab, "//iframe", "window.domAutomationController.send(document.title)", &title)); EXPECT_EQ("Referrer is " + test_server_->GetURL("files/referrer-policy-log.html").spec(), title); }
[ "duki994@gmail.com" ]
duki994@gmail.com
b4cb0a2dcee0064e20f8606da25c2491441323bc
d407f3bdbcdf70920bb8f0790c401dfb023af5de
/physics/Impact.cpp
2f294bde2ec15a3da5e16ccefd1298793d5c0050
[ "LicenseRef-scancode-unknown-license-reference", "BSD-2-Clause" ]
permissive
mathall/nanaka
3f02ffb4f2e19af3446d43af61226c122b18498c
0304f444702318a83d221645d4e5f3622082c456
refs/heads/master
2016-09-11T04:01:22.986788
2014-04-16T20:31:46
2014-04-26T12:56:01
11,401,646
2
0
null
null
null
null
UTF-8
C++
false
false
1,708
cpp
/* * Copyright (c) 2013, Mathias Hällman. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #include "physics/Impact.h" Impact::Impact( const CollisionShape* collider, const CollisionShape* collidee, Vec3f penetration) { m_collider = collider; m_collidee = collidee; m_penetration = penetration; } void Impact::Reverse() { auto tmp = m_collider; m_collider = m_collidee; m_collidee = tmp; m_penetration *= -1; }
[ "mathias87@gmail.com" ]
mathias87@gmail.com
bd40740633424bba2782e97ba3c9c53b8354c0cd
e217eaf05d0dab8dd339032b6c58636841aa8815
/Ifc4/src/OpenInfraPlatform/Ifc4/entity/include/IfcElementType.h
c9f71f656afc3678deb303c63a7ea9827e2c2d10
[]
no_license
bigdoods/OpenInfraPlatform
f7785ebe4cb46e24d7f636e1b4110679d78a4303
0266e86a9f25f2ea9ec837d8d340d31a58a83c8e
refs/heads/master
2021-01-21T03:41:20.124443
2016-01-26T23:20:21
2016-01-26T23:20:21
57,377,206
0
1
null
2016-04-29T10:38:19
2016-04-29T10:38:19
null
UTF-8
C++
false
false
3,145
h
/*! \verbatim * \copyright Copyright (c) 2015 Julian Amann. All rights reserved. * \author Julian Amann <julian.amann@tum.de> (https://www.cms.bgu.tum.de/en/team/amann) * \brief This file is part of the OpenInfraPlatform. * \endverbatim */ #pragma once #include <vector> #include <map> #include <sstream> #include <string> #include "OpenInfraPlatform/Ifc4/model/shared_ptr.h" #include "OpenInfraPlatform/Ifc4/model/Ifc4Object.h" #include "IfcTypeProduct.h" namespace OpenInfraPlatform { namespace Ifc4 { class IfcLabel; //ENTITY class IfcElementType : public IfcTypeProduct { public: IfcElementType(); IfcElementType( int id ); ~IfcElementType(); // method setEntity takes over all attributes from another instance of the class virtual void setEntity( shared_ptr<Ifc4Entity> other ); virtual void getStepLine( std::stringstream& stream ) const; virtual void getStepParameter( std::stringstream& stream, bool is_select_type = false ) const; virtual void readStepData( std::vector<std::string>& args, const std::map<int,shared_ptr<Ifc4Entity> >& map ); virtual void setInverseCounterparts( shared_ptr<Ifc4Entity> ptr_self ); virtual void unlinkSelf(); virtual const char* classname() const { return "IfcElementType"; } // IfcRoot ----------------------------------------------------------- // attributes: // shared_ptr<IfcGloballyUniqueId> m_GlobalId; // shared_ptr<IfcOwnerHistory> m_OwnerHistory; //optional // shared_ptr<IfcLabel> m_Name; //optional // shared_ptr<IfcText> m_Description; //optional // IfcObjectDefinition ----------------------------------------------------------- // inverse attributes: // std::vector<weak_ptr<IfcRelAssigns> > m_HasAssignments_inverse; // std::vector<weak_ptr<IfcRelNests> > m_Nests_inverse; // std::vector<weak_ptr<IfcRelNests> > m_IsNestedBy_inverse; // std::vector<weak_ptr<IfcRelDeclares> > m_HasContext_inverse; // std::vector<weak_ptr<IfcRelAggregates> > m_IsDecomposedBy_inverse; // std::vector<weak_ptr<IfcRelAggregates> > m_Decomposes_inverse; // std::vector<weak_ptr<IfcRelAssociates> > m_HasAssociations_inverse; // IfcTypeObject ----------------------------------------------------------- // attributes: // shared_ptr<IfcIdentifier> m_ApplicableOccurrence; //optional // std::vector<shared_ptr<IfcPropertySetDefinition> > m_HasPropertySets; //optional // inverse attributes: // std::vector<weak_ptr<IfcRelDefinesByType> > m_Types_inverse; // IfcTypeProduct ----------------------------------------------------------- // attributes: // std::vector<shared_ptr<IfcRepresentationMap> > m_RepresentationMaps; //optional // shared_ptr<IfcLabel> m_Tag; //optional // inverse attributes: // std::vector<weak_ptr<IfcRelAssignsToProduct> > m_ReferencedBy_inverse; // IfcElementType ----------------------------------------------------------- // attributes: shared_ptr<IfcLabel> m_ElementType; //optional }; } // end namespace Ifc4 } // end namespace OpenInfraPlatform
[ "julian.amann@tum.de" ]
julian.amann@tum.de
76f30bb6d4cf37cb2229900ad424a615aab054b3
1d8fcc8c0026c8f60e9310c19439627f5cd75f19
/CalderianMobiles/MobileModel.h
7dbacf9627a254e9862e0c906cd0fc29dc354ee3
[]
no_license
dritchie/simference
6a1fe7ab351e77efe05b514dc17b6ee0f103ce7d
6d67acda8b7208c75fe0bb24efd930879b1e3e7c
refs/heads/master
2020-05-18T18:22:19.955150
2013-03-21T22:31:37
2013-03-21T22:31:37
8,104,482
2
0
null
null
null
null
UTF-8
C++
false
false
811
h
#ifndef __MOBILE_MODEL_H #define __MOBILE_MODEL_H #include "../Common/Model.h" #include "Mobile.h" namespace simference { namespace Models { class MobileFactorTemplate : public FactorTemplate { public: MobileFactorTemplate(const Eigen::Vector3d& a) : anchor(a) {} void unroll(StructurePtr s, std::vector<FactorPtr>& factors) const; class Factor : public simference::Models::Factor { public: Factor(StructurePtr s, const Eigen::Vector3d& anchor); stan::agrad::var log_prob(const ParameterVector<stan::agrad::var>& params); static bool collisionsEnabled; static double collisionScaleFactor; static bool torqueEnabled; static double torqueScaleFactor; private: Mobile<stan::agrad::var> mobile; }; private: Eigen::Vector3d anchor; }; } } #endif
[ "daniel.c.ritchie@gmail.com" ]
daniel.c.ritchie@gmail.com
42ee76e9654d1115260f43c1ea67269484566031
f1f81da43d61f047865fc4f9e7da0c3bfa76d73a
/Profiler/lib/yaml-cpp/include/yaml-cpp/exceptions.h
eae31968b7ffac70cf2b9e4bb228308b4f056fb6
[ "MIT", "Apache-2.0" ]
permissive
cqse/teamscale-profiler-dotnet
9c5de70751e1bf4fe3ccd496bedbc911c50ff3ab
ce8378722962b5ffb25f2b091fb4ff2205978232
refs/heads/master
2023-08-31T02:29:07.158064
2023-08-24T07:40:41
2023-08-24T07:40:41
120,932,815
11
6
Apache-2.0
2023-08-18T11:56:43
2018-02-09T17:04:18
C#
UTF-8
C++
false
false
9,517
h
#ifndef EXCEPTIONS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 #define EXCEPTIONS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 #if defined(_MSC_VER) || \ (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 #pragma once #endif #include "yaml-cpp/mark.h" #include "yaml-cpp/traits.h" #include <sstream> #include <stdexcept> #include <string> #define YAML_CPP_NOEXCEPT noexcept namespace YAML { // error messages namespace ErrorMsg { const char* const YAML_DIRECTIVE_ARGS = "YAML directives must have exactly one argument"; const char* const YAML_VERSION = "bad YAML version: "; const char* const YAML_MAJOR_VERSION = "YAML major version too large"; const char* const REPEATED_YAML_DIRECTIVE = "repeated YAML directive"; const char* const TAG_DIRECTIVE_ARGS = "TAG directives must have exactly two arguments"; const char* const REPEATED_TAG_DIRECTIVE = "repeated TAG directive"; const char* const CHAR_IN_TAG_HANDLE = "illegal character found while scanning tag handle"; const char* const TAG_WITH_NO_SUFFIX = "tag handle with no suffix"; const char* const END_OF_VERBATIM_TAG = "end of verbatim tag not found"; const char* const END_OF_MAP = "end of map not found"; const char* const END_OF_MAP_FLOW = "end of map flow not found"; const char* const END_OF_SEQ = "end of sequence not found"; const char* const END_OF_SEQ_FLOW = "end of sequence flow not found"; const char* const MULTIPLE_TAGS = "cannot assign multiple tags to the same node"; const char* const MULTIPLE_ANCHORS = "cannot assign multiple anchors to the same node"; const char* const MULTIPLE_ALIASES = "cannot assign multiple aliases to the same node"; const char* const ALIAS_CONTENT = "aliases can't have any content, *including* tags"; const char* const INVALID_HEX = "bad character found while scanning hex number"; const char* const INVALID_UNICODE = "invalid unicode: "; const char* const INVALID_ESCAPE = "unknown escape character: "; const char* const UNKNOWN_TOKEN = "unknown token"; const char* const DOC_IN_SCALAR = "illegal document indicator in scalar"; const char* const EOF_IN_SCALAR = "illegal EOF in scalar"; const char* const CHAR_IN_SCALAR = "illegal character in scalar"; const char* const TAB_IN_INDENTATION = "illegal tab when looking for indentation"; const char* const FLOW_END = "illegal flow end"; const char* const BLOCK_ENTRY = "illegal block entry"; const char* const MAP_KEY = "illegal map key"; const char* const MAP_VALUE = "illegal map value"; const char* const ALIAS_NOT_FOUND = "alias not found after *"; const char* const ANCHOR_NOT_FOUND = "anchor not found after &"; const char* const CHAR_IN_ALIAS = "illegal character found while scanning alias"; const char* const CHAR_IN_ANCHOR = "illegal character found while scanning anchor"; const char* const ZERO_INDENT_IN_BLOCK = "cannot set zero indentation for a block scalar"; const char* const CHAR_IN_BLOCK = "unexpected character in block scalar"; const char* const AMBIGUOUS_ANCHOR = "cannot assign the same alias to multiple nodes"; const char* const UNKNOWN_ANCHOR = "the referenced anchor is not defined"; const char* const INVALID_NODE = "invalid node; this may result from using a map iterator as a sequence " "iterator, or vice-versa"; const char* const INVALID_SCALAR = "invalid scalar"; const char* const KEY_NOT_FOUND = "key not found"; const char* const BAD_CONVERSION = "bad conversion"; const char* const BAD_DEREFERENCE = "bad dereference"; const char* const BAD_SUBSCRIPT = "operator[] call on a scalar"; const char* const BAD_PUSHBACK = "appending to a non-sequence"; const char* const BAD_INSERT = "inserting in a non-convertible-to-map"; const char* const UNMATCHED_GROUP_TAG = "unmatched group tag"; const char* const UNEXPECTED_END_SEQ = "unexpected end sequence token"; const char* const UNEXPECTED_END_MAP = "unexpected end map token"; const char* const SINGLE_QUOTED_CHAR = "invalid character in single-quoted string"; const char* const INVALID_ANCHOR = "invalid anchor"; const char* const INVALID_ALIAS = "invalid alias"; const char* const INVALID_TAG = "invalid tag"; const char* const BAD_FILE = "bad file"; template <typename T> inline const std::string KEY_NOT_FOUND_WITH_KEY( const T&, typename disable_if<is_numeric<T>>::type* = 0) { return KEY_NOT_FOUND; } inline const std::string KEY_NOT_FOUND_WITH_KEY(const std::string& key) { std::stringstream stream; stream << KEY_NOT_FOUND << ": " << key; return stream.str(); } template <typename T> inline const std::string KEY_NOT_FOUND_WITH_KEY( const T& key, typename enable_if<is_numeric<T>>::type* = 0) { std::stringstream stream; stream << KEY_NOT_FOUND << ": " << key; return stream.str(); } } class YAML_CPP_API Exception : public std::runtime_error { public: Exception(const Mark& mark_, const std::string& msg_) : std::runtime_error(build_what(mark_, msg_)), mark(mark_), msg(msg_) {} virtual ~Exception() YAML_CPP_NOEXCEPT; Exception(const Exception&) = default; Mark mark; std::string msg; private: static const std::string build_what(const Mark& mark, const std::string& msg) { if (mark.is_null()) { return msg.c_str(); } std::stringstream output; output << "yaml-cpp: error at line " << mark.line + 1 << ", column " << mark.column + 1 << ": " << msg; return output.str(); } }; class YAML_CPP_API ParserException : public Exception { public: ParserException(const Mark& mark_, const std::string& msg_) : Exception(mark_, msg_) {} ParserException(const ParserException&) = default; virtual ~ParserException() YAML_CPP_NOEXCEPT; }; class YAML_CPP_API RepresentationException : public Exception { public: RepresentationException(const Mark& mark_, const std::string& msg_) : Exception(mark_, msg_) {} RepresentationException(const RepresentationException&) = default; virtual ~RepresentationException() YAML_CPP_NOEXCEPT; }; // representation exceptions class YAML_CPP_API InvalidScalar : public RepresentationException { public: InvalidScalar(const Mark& mark_) : RepresentationException(mark_, ErrorMsg::INVALID_SCALAR) {} InvalidScalar(const InvalidScalar&) = default; virtual ~InvalidScalar() YAML_CPP_NOEXCEPT; }; class YAML_CPP_API KeyNotFound : public RepresentationException { public: template <typename T> KeyNotFound(const Mark& mark_, const T& key_) : RepresentationException(mark_, ErrorMsg::KEY_NOT_FOUND_WITH_KEY(key_)) { } KeyNotFound(const KeyNotFound&) = default; virtual ~KeyNotFound() YAML_CPP_NOEXCEPT; }; template <typename T> class YAML_CPP_API TypedKeyNotFound : public KeyNotFound { public: TypedKeyNotFound(const Mark& mark_, const T& key_) : KeyNotFound(mark_, key_), key(key_) {} virtual ~TypedKeyNotFound() YAML_CPP_NOEXCEPT {} T key; }; template <typename T> inline TypedKeyNotFound<T> MakeTypedKeyNotFound(const Mark& mark, const T& key) { return TypedKeyNotFound<T>(mark, key); } class YAML_CPP_API InvalidNode : public RepresentationException { public: InvalidNode() : RepresentationException(Mark::null_mark(), ErrorMsg::INVALID_NODE) {} InvalidNode(const InvalidNode&) = default; virtual ~InvalidNode() YAML_CPP_NOEXCEPT; }; class YAML_CPP_API BadConversion : public RepresentationException { public: explicit BadConversion(const Mark& mark_) : RepresentationException(mark_, ErrorMsg::BAD_CONVERSION) {} BadConversion(const BadConversion&) = default; virtual ~BadConversion() YAML_CPP_NOEXCEPT; }; template <typename T> class TypedBadConversion : public BadConversion { public: explicit TypedBadConversion(const Mark& mark_) : BadConversion(mark_) {} }; class YAML_CPP_API BadDereference : public RepresentationException { public: BadDereference() : RepresentationException(Mark::null_mark(), ErrorMsg::BAD_DEREFERENCE) {} BadDereference(const BadDereference&) = default; virtual ~BadDereference() YAML_CPP_NOEXCEPT; }; class YAML_CPP_API BadSubscript : public RepresentationException { public: BadSubscript() : RepresentationException(Mark::null_mark(), ErrorMsg::BAD_SUBSCRIPT) {} BadSubscript(const BadSubscript&) = default; virtual ~BadSubscript() YAML_CPP_NOEXCEPT; }; class YAML_CPP_API BadPushback : public RepresentationException { public: BadPushback() : RepresentationException(Mark::null_mark(), ErrorMsg::BAD_PUSHBACK) {} BadPushback(const BadPushback&) = default; virtual ~BadPushback() YAML_CPP_NOEXCEPT; }; class YAML_CPP_API BadInsert : public RepresentationException { public: BadInsert() : RepresentationException(Mark::null_mark(), ErrorMsg::BAD_INSERT) {} BadInsert(const BadInsert&) = default; virtual ~BadInsert() YAML_CPP_NOEXCEPT; }; class YAML_CPP_API EmitterException : public Exception { public: EmitterException(const std::string& msg_) : Exception(Mark::null_mark(), msg_) {} EmitterException(const EmitterException&) = default; virtual ~EmitterException() YAML_CPP_NOEXCEPT; }; class YAML_CPP_API BadFile : public Exception { public: BadFile() : Exception(Mark::null_mark(), ErrorMsg::BAD_FILE) {} BadFile(const BadFile&) = default; virtual ~BadFile() YAML_CPP_NOEXCEPT; }; } #undef YAML_CPP_NOEXCEPT #endif // EXCEPTIONS_H_62B23520_7C8E_11DE_8A39_0800200C9A66
[ "streitel@cqse.eu" ]
streitel@cqse.eu
4f9dc5ea88f12e2553d2df96eb881f0880af3848
9e1e09ea61632e80465f371a083625d03b1e5ab2
/src/Common/StringOutputStream.cpp
db2997ec88cff72d2f105dc5cd6fb62eea6f663c
[ "MIT" ]
permissive
bitcoin-note/bitcoin-note
0f93c5a04dda2df6ff838187d894a0c4af633649
7be1e60f327b7ce1f995fee97f80131dcb934e70
refs/heads/master
2021-05-11T19:50:51.485229
2018-01-18T00:05:24
2018-01-18T00:05:24
117,895,059
3
2
null
null
null
null
UTF-8
C++
false
false
460
cpp
// Copyright (c) 2018, The Bitcoin Note Developers. // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "StringOutputStream.h" namespace Common { StringOutputStream::StringOutputStream(std::string& out) : out(out) { } size_t StringOutputStream::writeSome(const void* data, size_t size) { out.append(static_cast<const char*>(data), size); return size; } }
[ "bitnotecurrency@gmail.com" ]
bitnotecurrency@gmail.com
ad04a6304753c06fbdef948157eee19e2007208e
630a68871d4cdcc9dbc1f8ac8b44f579ff994ecf
/monitor/hook/KeyboardMonitor.cpp
ba30de68dde105286a2ff275e5544ce60592dcda
[ "MIT" ]
permissive
FFMG/myoddweb.piger
b56b3529346d9a1ed23034098356ea420c04929d
6f5a183940661bd7457e6a497fd39509e186cbf5
refs/heads/master
2023-01-09T12:45:27.156140
2022-12-31T12:40:31
2022-12-31T12:40:31
52,210,495
19
2
MIT
2022-12-31T12:40:32
2016-02-21T14:31:50
C++
UTF-8
C++
false
false
8,084
cpp
#include "stdafx.h" #include "KeyboardMonitor.h" #include "hook.h" KeyboardMonitor* keyboardMonitor; KeyboardMonitor::KeyboardMonitor(const HANDLE hModule ) : m_hModule( hModule ), m_bRejectKeyBoardInputs(false), m_hhook(nullptr) { UWM_KEYBOARD_CHAR = RegisterWindowMessage(UWM_KEYBOARD_MSG_CHAR); UWM_KEYBOARD_UP = RegisterWindowMessage(UWM_KEYBOARD_MSG_UP); UWM_KEYBOARD_DOWN = RegisterWindowMessage(UWM_KEYBOARD_MSG_DOWN); } KeyboardMonitor::~KeyboardMonitor() { ClearHooks(); } // ----------------------------------------------------------------------- bool KeyboardMonitor::HandleHook ( const int nCode ) { if(nCode < 0 || HC_ACTION != nCode ) { return false; } return true; } // ----------------------------------------------------------------------- LRESULT CALLBACK KeyboardMonitor::CallLowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam) { // are we handling that hook? if(false == keyboardMonitor->HandleHook( nCode )) { return CallNextHookEx( keyboardMonitor->GetHhook(), nCode, wParam, lParam); } // By returning a non-zero value from the hook procedure, the // message does not get passed to the target window const auto *pkbhs = reinterpret_cast<KBDLLHOOKSTRUCT *>(lParam); switch (nCode) { case HC_ACTION: { const auto hHandle = keyboardMonitor->HandleMessage( wParam, pkbhs->vkCode, pkbhs->dwExtraInfo ); switch ( hHandle ) { case 1: // the key was handled by someone { // if we have been instructed to reject messages simply change the message to nothing // other processes are supposed to ignore WM_NULL // this is not full proof, (we might not be the first hook in the queue), but the odds of // multiple hooks all trying to do the same thing is limited. if( keyboardMonitor->RejectKeyboadInputs() == true) { return 1; } } break; case 0: break; default: break; } } // if it is a special key then we must not handle it. // even if it is a repeat key... if (keyboardMonitor->IsSpecialKey( pkbhs->vkCode ) ) { keyboardMonitor->HandleMessage( wParam, VK_CAPITAL, 0 ); // TRACE( "Rejected Caps Lock Key\n" ); return 1; } break; // HC_ACTION default: break; } return CallNextHookEx ( keyboardMonitor->GetHhook(), nCode, wParam, lParam); }// CallLowLevelKeyboardProc /** * \brief check if the given param means that the one of the special key was pressed. * \param wParam the key we are checking against. * \return if the given key is a special key or not. */ bool KeyboardMonitor::IsSpecialKey( const WPARAM wParam ) const { for(auto it = m_mapWindows.begin(); it != m_mapWindows.end(); ++it ) { if( wParam == it->second ) { // yes, this window uses that key. return true; } } // if we are here we never found it. return false; } // ----------------------------------------------------------------------- /** * Given the message that was passed we must either send it to the parent window * Or simply return 0L */ LRESULT KeyboardMonitor::HandleMessage ( const UINT msg, const WPARAM wParam, const LPARAM lParam ) { if( msg < WM_KEYFIRST || msg > WM_KEYLAST) { return 0L; } // get the number of milli secs from start of system const auto tick = GetTickCount(); // // do not allow items to be too quick if( GetLastKey( tick ) .Similar( msg, wParam) ) { // the key we just entered has been repeated too soon for us and is rejected. // TRACE( "<< Repeat Key >>\n" ); return 0L; } // save the last key so we can keep track of the timing // it is not uncommon for apps to request the last key more than once. SetLastKey( LAST_KEY(msg, wParam, tick) ); auto lResult = 0L; // assume that nobody will handle it. for( auto it = m_mapWindows.begin(); it != m_mapWindows.end(); ++it ) { const auto hWnd = it->first; switch( msg ) { case WM_KEYDOWN: // they key was handled by at least one persone. lResult = 1L; PostMessage( hWnd, UWM_KEYBOARD_DOWN, wParam, lParam ); break; case WM_KEYUP: // they key was handled by at least one persone. lResult = 1L; PostMessage(hWnd, UWM_KEYBOARD_UP, wParam, lParam ); break; case WM_CHAR: // they key was handled by at least one persone. lResult = 1L; PostMessage(hWnd, UWM_KEYBOARD_CHAR, wParam, lParam ); break; default: // Not handled or we don't care. break; } } return lResult; } // ----------------------------------------------------------------------- bool KeyboardMonitor::RejectKeyboadInputs(bool bReject ) { const auto bThen = m_bRejectKeyBoardInputs; m_bRejectKeyBoardInputs = bReject; return bThen; } // ----------------------------------------------------------------------- /** * Returns if we must reject all keyboard inputs/ * * @return bool return true if we are rejecting all keyboard inputs. */ bool KeyboardMonitor::RejectKeyboadInputs( ) const { return m_bRejectKeyBoardInputs; } // ----------------------------------------------------------------------- void KeyboardMonitor::SetLastKey( const LAST_KEY& lk ) { m_lk = lk; } /** * \brief if the last DWORD used was more than 100 milliseconds ago we can assume that it is a new key * so we just return an empty key. * * \param dwCurrentMilli the current time so we can compare if the last key was a long time ago, * \return LAST_KEY the last key that was saved. */ KeyboardMonitor::LAST_KEY KeyboardMonitor::GetLastKey( const DWORD dwCurrentMilli) const { if( (dwCurrentMilli - m_lk.tick() ) > 100 /* 100 milli seconds*/) { // it was more than 100ms so even if it is a repeat we do not care and we // should return it //TRACE( "<< Repeat Key %lu>>\n" ); return LAST_KEY( 0, 0x0000); // took too long, do not return } //TRACE( "<< Non Repeat Key %lu>>\n", dwCurrentMilli - m_lk.tick() ); // that is the key that occured less than 100ms ago return m_lk; } // ----------------------------------------------------------------------- bool KeyboardMonitor::RemoveHwnd( const HWND hWnd ) { const auto iter = m_mapWindows.find( hWnd ); if( iter == m_mapWindows.end() ) { // don't know that item return false; } // remove it m_mapWindows.erase( iter ); // do we need the hook anymore? if( m_mapWindows.size() == 0 ) { return ClearHooks(); } // if we are here then we still have some hooks needed. return true; } // ----------------------------------------------------------------------- bool KeyboardMonitor::CreateHooks() { // have we already created the hooks? if(nullptr != GetHhook() ) { return true; } // hook into the low level keyboard message const auto hookllKey = SetWindowsHookEx(WH_KEYBOARD_LL, static_cast<HOOKPROC>(CallLowLevelKeyboardProc), static_cast<HINSTANCE>(m_hModule),0); // make sure that they are all created properly. if( hookllKey == nullptr) { return false; } // save the value SetHhook( hookllKey ); return true; } // ----------------------------------------------------------------------- bool KeyboardMonitor::ClearHooks( ) { if( nullptr == GetHhook() ) { // we were not hooked in the first place. return false; } const auto bResult = UnhookWindowsHookEx( GetHhook() ); // what ever happened, (true or False), the user no longer wants that hook. SetHhook(nullptr); return bResult; } // ----------------------------------------------------------------------- bool KeyboardMonitor::AddHwnd( const HWND hWnd, const WPARAM vKey ) { if( !CreateHooks() ) { return false; } // do we aready have that window? const auto iter = m_mapWindows.find( hWnd ); if( iter != m_mapWindows.end() ) { return false; // already exists. } // this is new so we need to add it here. m_mapWindows[ hWnd ] = vKey; return true; // this was added. }
[ "github@myoddweb.com" ]
github@myoddweb.com
ebc36338c87aaf447cd30c72aef39d8327cfe73b
45f57eb0a552891b44e6d55783f0286480ae5f71
/FinalProject/movieInfo.hpp
124fdc9cbd67c61eaefbdae475e29414da88065e
[]
no_license
JakinChan200/CS100
21e169dec45326852cb10e36798087ea996baa04
e42ec7a24239bb3eb465a90fa19393bb9a39b346
refs/heads/main
2023-02-08T15:01:24.233925
2020-12-22T07:52:16
2020-12-22T07:52:16
323,548,180
0
0
null
null
null
null
UTF-8
C++
false
false
596
hpp
#ifndef MOVIEINFO_HPP #define MOVIEINFO_HPP //#include "calculations.hpp" #include "Visitor.hpp" #include "movieInfo.hpp" #include <iostream> #include <vector> #include <string> using namespace std; //class Calculation; class MovieInfo { public: MovieInfo(){}; virtual string output_Info() = 0; //virtual void add() = 0; virtual string getName() = 0; virtual string getGenre() = 0; virtual int getRating() = 0; virtual int getRunTime() = 0; virtual int getYear() = 0; virtual void accept(Visitor* visi) = 0; }; #endif
[ "JakinChan200@gmail.com" ]
JakinChan200@gmail.com
ff2cb917b09f03e612375115e9712dce6cd6b27a
c14500adc5ce57e216123138e8ab55c3e9310953
/Mesh/Levy3D.h
7c48003895bfa120ea0353ef430e316b4384d595
[ "LicenseRef-scancode-warranty-disclaimer", "LGPL-2.0-or-later", "LicenseRef-scancode-generic-exception", "GPL-1.0-or-later", "LicenseRef-scancode-proprietary-license", "GPL-2.0-only", "GPL-2.0-or-later", "LicenseRef-scancode-other-copyleft", "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
ResonanceGroup/GMSH304
8c8937ed3839c9c85ab31c7dd2a37568478dc08e
a07a210131ee7db8c0ea5e22386270ceab44a816
refs/heads/master
2020-03-14T23:58:48.751856
2018-05-02T13:51:09
2018-05-02T13:51:09
131,857,142
0
1
MIT
2018-05-02T13:51:10
2018-05-02T13:47:05
null
UTF-8
C++
false
false
2,655
h
// Gmsh - Copyright (C) 1997-2017 C. Geuzaine, J.-F. Remacle // // See the LICENSE.txt file for license information. Please report all // bugs and problems to the public mailing list <gmsh@onelab.info>. // // Contributor(s): // Tristan Carrier #ifndef _LEVY3D_H_ #define _LEVY3D_H_ #include <list> #include "SVector3.h" #include "fullMatrix.h" #include "GRegion.h" #include "MElementOctree.h" class VoronoiVertex{ private: SPoint3 point; int category; int index1; int index2; int index3; int index4; SVector3 normal1; SVector3 normal2; double h; public: VoronoiVertex(); ~VoronoiVertex(); SPoint3 get_point(); int get_category(); int get_index1(); int get_index2(); int get_index3(); int get_index4(); SVector3 get_normal1(); SVector3 get_normal2(); double get_h(); void set_point(SPoint3); void set_category(int); void set_index1(int); void set_index2(int); void set_index3(int); void set_index4(int); void set_normal1(SVector3); void set_normal2(SVector3); void set_h(double); }; class Tensor{ private: double t11,t21,t31,t12,t22,t32,t13,t23,t33; public: Tensor(); ~Tensor(); void set_t11(double); void set_t21(double); void set_t31(double); void set_t12(double); void set_t22(double); void set_t32(double); void set_t13(double); void set_t23(double); void set_t33(double); double get_t11(); double get_t21(); double get_t31(); double get_t12(); double get_t22(); double get_t32(); double get_t13(); double get_t23(); double get_t33(); }; class VoronoiElement{ private: VoronoiVertex v1; VoronoiVertex v2; VoronoiVertex v3; VoronoiVertex v4; double jacobian; double dh_dx; double dh_dy; double dh_dz; Tensor t; public: VoronoiElement(); ~VoronoiElement(); VoronoiVertex get_v1(); VoronoiVertex get_v2(); VoronoiVertex get_v3(); VoronoiVertex get_v4(); double get_jacobian(); double get_dh_dx(); double get_dh_dy(); double get_dh_dz(); Tensor get_tensor(); void set_v1(VoronoiVertex); void set_v2(VoronoiVertex); void set_v3(VoronoiVertex); void set_v4(VoronoiVertex); void set_tensor(Tensor); double get_h(double,double,double); void deriv_h(); void compute_jacobian(); double T(double,double,double,double,double,double,double); void swap(); double get_quality(); }; class LpSmoother{ private: int max_iter; int norm; static std::vector<MVertex*> interior_vertices; public: LpSmoother(int,int); ~LpSmoother(); void improve_model(); void improve_region(GRegion*); static int get_nbr_interior_vertices(); static MVertex* get_interior_vertex(int); }; #endif
[ "=phillipmobley2@gmail.com" ]
=phillipmobley2@gmail.com
320f106e95ba25cb5bff643224cea23f70cda131
214ff7c2eb0bba4a504b17ba3e148396a5d3005c
/PrintNegativeNumbers.cpp
dc08c961abe22f773acbcae83bb0794571877f5d
[]
no_license
RahulBantode/c_cpp_practice
08071b33fd859e9d0e04c69087e36ec77bcf9164
135276411ff2d60279340e665b922bc265571801
refs/heads/main
2023-05-15T04:01:03.475007
2021-06-14T06:27:25
2021-06-14T06:27:25
376,720,345
0
0
null
null
null
null
UTF-8
C++
false
false
640
cpp
/*Problem Statement :- Write a program to print all the negative numbers in the array */ #include<iostream> #define MAX 50 using namespace std; void PrintNegativeNumbers(int arr[],int size) { int i; cout<<"Negative numbers are : \n"; for(i=0; i<size; i++) { if(arr[i] < 0) cout<<arr[i]<<" ,"; } cout<<endl; } int main() { int arr[MAX],size; cout<<"Enter the size of array : "; cin>>size; cout<<"Enter the elements into array : \n"; for(int i=0; i<size; i++) { cout<<"Enter element "<<i+1<<" : "; cin>>arr[i]; } PrintNegativeNumbers(arr,size); return 0; }
[ "noreply@github.com" ]
noreply@github.com
7896cff19043a79be99a11a13764f5f754e30a70
d7c2999cae6f2539efa3348618e9cbd5d6e2f265
/include/neovim_utils.hpp
5a30722a7801fb6737df98097828f58ef54227d3
[]
permissive
tsubota-kouga/neovim.cpp
de42cbc58d8582875671fe86a4b3823351116f5b
379762e0661c3153d916be2a677de636c02c5b64
refs/heads/master
2020-04-14T02:28:27.866208
2019-03-17T13:59:10
2019-03-17T13:59:10
163,583,460
1
0
BSD-3-Clause
2018-12-30T11:50:20
2018-12-30T11:50:19
null
UTF-8
C++
false
false
248
hpp
#ifndef ___Neovim_util_H_ #define ___Neovim_util_H_ namespace utils { constexpr short BIN1x1 = 0b10000000; constexpr short BIN1x2 = 0b11000000; constexpr short BIN1x3 = 0b11100000; constexpr short BIN1x4 = 0b11110000; } // namespace utils #endif
[ "kouga.infini@gmail.com" ]
kouga.infini@gmail.com
b7b5d4e373721e6e90f253d39636c94fa0f1a255
880b2f6dbebd5369f09127bc764105fb28a1af4c
/src/ofxAEMask.cpp
a8c7157921ee3c777abb6a29a0bca2e566892aa5
[]
no_license
saadahid/ofxAE
d6b94569917f0273c12a79f77197619f4aea81f9
d99cd6b7a0c965615dd65977818f21e36b7c4379
refs/heads/master
2021-01-21T09:17:27.834471
2013-10-07T04:34:20
2013-10-07T04:34:20
null
0
0
null
null
null
null
UTF-8
C++
false
false
437
cpp
#include "ofxAEMask.h" #include "ofxAEAVLayer.h" #include "ofGraphics.h" namespace ofxAE { Mask::Mask() { ofPath& path = path_.get(); path.setPolyWindingMode(OF_POLY_WINDING_POSITIVE); path.setColor(ofColor::white); } void Mask::draw() { ofPath& path = path_.get(); ofPushStyle(); ofEnableBlendMode(blend_mode_); path.draw(); ofPopStyle(); } bool Mask::isSubtract() { return blend_mode_==OF_BLENDMODE_SUBTRACT; } } /* EOF */
[ "nariakiiwatani@annolab.com" ]
nariakiiwatani@annolab.com
0540989a6016b2faefae4ac7c365cb5ba2374f1c
69d335881ac4f4f78506ad53db1ae066419c62fc
/src/sysc/kernel/sc_module_registry.h
cd9985203ff75e8ff258d1fb34ebf7b078f7f5ea
[ "Apache-2.0" ]
permissive
ncihnegn/systemc-2.3.3
c30cb9bbbdf8bc26455d5a1d88ddfa0a48d4cbef
1e2386f5b84c1d6857237fbfbed2c4462d2ea800
refs/heads/master
2022-12-20T01:16:48.146391
2020-10-06T15:13:05
2020-10-06T15:18:54
null
0
0
null
null
null
null
UTF-8
C++
false
false
3,489
h
/***************************************************************************** Licensed to Accellera Systems Initiative Inc. (Accellera) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Accellera licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *****************************************************************************/ /***************************************************************************** sc_module_registry.h -- Registry for all modules. FOR INTERNAL USE ONLY. Original Author: Martin Janssen, Synopsys, Inc., 2001-05-21 CHANGE LOG AT THE END OF THE FILE *****************************************************************************/ #ifndef SC_MODULE_REGISTRY_H #define SC_MODULE_REGISTRY_H #include <vector> namespace sc_core { class sc_module; class sc_simcontext; // ---------------------------------------------------------------------------- // CLASS : sc_module_registry // // Registry for all modules. // FOR INTERNAL USE ONLY! // ---------------------------------------------------------------------------- class sc_module_registry { friend class sc_simcontext; public: void insert( sc_module& ); void remove( sc_module& ); int size() const { return m_module_vec.size(); } private: // constructor explicit sc_module_registry( sc_simcontext& simc_ ); // destructor ~sc_module_registry(); // called when construction is done bool construction_done(); // called when elaboration is done void elaboration_done(); // called before simulation begins void start_simulation(); // called after simulation ends void simulation_done(); private: int m_construction_done; std::vector<sc_module*> m_module_vec; sc_simcontext* m_simc; private: // disabled sc_module_registry(); sc_module_registry( const sc_module_registry& ); sc_module_registry& operator = ( const sc_module_registry& ); }; } // namespace sc_core #endif // $Log: sc_module_registry.h,v $ // Revision 1.6 2011/08/26 20:46:10 acg // Andy Goodrich: moved the modification log to the end of the file to // eliminate source line number skew when check-ins are done. // // Revision 1.5 2011/05/09 04:07:49 acg // Philipp A. Hartmann: // (1) Restore hierarchy in all phase callbacks. // (2) Ensure calls to before_end_of_elaboration. // // Revision 1.4 2011/02/18 20:27:14 acg // Andy Goodrich: Updated Copyrights. // // Revision 1.3 2011/02/13 21:47:37 acg // Andy Goodrich: update copyright notice. // // Revision 1.2 2008/05/22 17:06:26 acg // Andy Goodrich: updated copyright notice to include 2008. // // Revision 1.1.1.1 2006/12/15 20:20:05 acg // SystemC 2.3 // // Revision 1.3 2006/01/13 18:44:30 acg // Added $Log to record CVS changes into the source. // Taf!
[ "ncihnegn@users.noreply.github.com" ]
ncihnegn@users.noreply.github.com
0acb331b5465669d2af8bb092a360aa4feba855f
aa2ac425a8bb957a26763ae17e50d50f1cce8956
/src/Addons/GeoStar/LibVCT/stdafx.cpp
577de3b94fe081b5b21faa6cb1d78a48c503057b
[]
no_license
radtek/CGISS
c7289ed19d912c432aae81d0cdbb6b080b4f5458
3f7cfa19d8024a67a5350d51e3f2f40a5e203576
refs/heads/master
2023-03-16T21:23:56.948744
2017-06-17T14:14:09
2017-06-17T14:14:09
null
0
0
null
null
null
null
GB18030
C++
false
false
258
cpp
// stdafx.cpp : 只包括标准包含文件的源文件 // LibVCT.pch 将作为预编译头 // stdafx.obj 将包含预编译类型信息 #include "stdafx.h" // TODO: 在 STDAFX.H 中 // 引用任何所需的附加头文件,而不是在此文件中引用
[ "hekaikai@live.cn" ]
hekaikai@live.cn
52c821af9c03298a79690edb596be3c421e81207
5ad99bf8f500cbb2bc7d532812dc33d5f642205d
/core/Serialize.h
e7a707111e43f8ab2fbc3c57e34d661e1d09b05c
[]
no_license
cmguo/just-p2p-trip-client
3cd4e861586b82376a3e10e98cb6afbd17611c0d
a200fea3c5afcb1da27d8201865a1c8511e0dc98
refs/heads/master
2022-11-18T23:08:37.256621
2018-07-13T01:41:33
2018-07-13T02:54:52
280,889,464
0
0
null
null
null
null
UTF-8
C++
false
false
4,826
h
// Serialize.h #ifndef _TRIP_CLIENT_CORE_SERIALIZE_H_ #define _TRIP_CLIENT_CORE_SERIALIZE_H_ #include "trip/client/core/Resource.h" #include "trip/client/core/Source.h" #include "trip/client/core/Sink.h" #include <util/serialization/NVPair.h> #include <util/serialization/stl/vector.h> #include <util/serialization/boost/intrusive_ptr.h> #include <util/serialization/Url.h> #include <util/serialization/Uuid.h> #include <util/serialization/Ordered.h> #include <util/serialization/Digest.h> namespace trip { namespace client { template <typename Archive> void serialize( Archive & ar, ResourceMeta & t) { ar & SERIALIZATION_NVP_1(t, duration) & SERIALIZATION_NVP_1(t, bytesize) & SERIALIZATION_NVP_1(t, interval) & SERIALIZATION_NVP_1(t, bitrate) & SERIALIZATION_NVP_1(t, segcount) & SERIALIZATION_NVP_1(t, file_extension); } SERIALIZATION_SPLIT_FREE(DataId) template <typename Archive> void save( Archive & ar, DataId const & t) { std::ostringstream oss; oss << t; ar & oss.str(); } template <typename Archive> void serialize( Archive & ar, Piece & t) { ar & SERIALIZATION_NVP_3(t, nref) & SERIALIZATION_NVP_3(t, type) & SERIALIZATION_NVP_3(t, data) & SERIALIZATION_NVP_3(t, size); } template <typename Archive> void serialize( Archive & ar, Block & t) { ar & SERIALIZATION_NVP_3(t, left) & SERIALIZATION_NVP_3(t, piece_count) & SERIALIZATION_NVP_3(t, last_piece_size); ar & SERIALIZATION_NVP_NAME("pieces", framework::container::make_array(t.pieces_)); } template <typename Archive> void serialize( Archive & ar, Segment & t) { ar & SERIALIZATION_NVP_3(t, left) & SERIALIZATION_NVP_3(t, block_count) & SERIALIZATION_NVP_3(t, last_block_size); ar & SERIALIZATION_NVP_NAME("blocks", framework::container::make_array(t.blocks_)); } template <typename Archive> void serialize( Archive & ar, SegmentMeta & t) { ar & SERIALIZATION_NVP_1(t, duration) & SERIALIZATION_NVP_1(t, bytesize) & SERIALIZATION_NVP_1(t, md5sum); } template <typename Archive> void serialize( Archive & ar, Segment2 & t) { ar & SERIALIZATION_NVP_1(t, id) & SERIALIZATION_NVP_1(t, saved) & SERIALIZATION_NVP_1(t, external) & SERIALIZATION_NVP_1(t, meta) & SERIALIZATION_NVP_1(t, seg); } template <typename Archive> void serialize( Archive & ar, ResourceData::Lock & t) { ar & SERIALIZATION_NVP_1(t, from) & SERIALIZATION_NVP_1(t, to); } template <typename Archive> void serialize( Archive & ar, ResourceData & t) { ar & SERIALIZATION_NVP_3(t, next) & SERIALIZATION_NVP_3(t, end) & SERIALIZATION_NVP_3(t, segments) & SERIALIZATION_NVP_3(t, locks) & SERIALIZATION_NVP_3(t, meta_dirty) & SERIALIZATION_NVP_3(t, meta_ready); } template <typename Archive> void serialize( Archive & ar, Resource & t) { ar & SERIALIZATION_NVP_2(t, id) & SERIALIZATION_NVP_2(t, meta); serialize(ar, (ResourceData &)t); } template <typename Archive> void serialize( Archive & ar, Source & t) { ar & SERIALIZATION_NVP_2(t, url) & SERIALIZATION_NVP_2(t, window_size) & SERIALIZATION_NVP_2(t, window_left); } template <typename Archive> void serialize( Archive & ar, Sink & t) { ar & SERIALIZATION_NVP_2(t, url) & SERIALIZATION_NVP_2(t, resource) // & SERIALIZATION_NVP_2(t, type) & SERIALIZATION_NVP_2(t, position) & SERIALIZATION_NVP_2(t, attached); } } } namespace util { namespace serialization { template <class Archive> struct is_single_unit<Archive, trip::client::DataId> : boost::true_type { }; } } #endif // _TRIP_CLIENT_CORE_SERIALIZE_H_
[ "isxxguo@pptv.com" ]
isxxguo@pptv.com
966244153669f75cb2ae4e7c19e98b0c69e62815
a7881a10dbeded9534f8c37d1655c1750d82518d
/device/modules/vdev_module.h
5c6a0cf371a397277b4ffe5c2622f4e40b9ad17e
[ "MIT" ]
permissive
aconstlink/natus
31130e7439c1bb983c35e5f8ed2e684677c6583a
8f8ad12aa71d246a10802bf5042f407de45d66d7
refs/heads/master
2023-08-17T01:58:03.578900
2023-03-29T12:45:45
2023-03-29T12:45:45
248,593,153
1
0
null
null
null
null
UTF-8
C++
false
false
1,501
h
#pragma once #include "../imodule.h" #include "../layouts/game_controller.hpp" #include <natus/ntd/vector.hpp> namespace natus { namespace device { // a system module that spawns virtual devices like game controllers. class NATUS_DEVICE_API vdev_module : public imodule { natus_this_typedefs( vdev_module ) ; struct data { bool_t xbox_added = false ; bool_t keyboard_added = false ; bool_t mouse_added = false ; natus::device::game_device_res_t dev ; }; natus::ntd::vector < data > _games ; public: vdev_module( void_t ) ; vdev_module( this_cref_t ) = delete ; vdev_module( this_rref_t ) ; virtual ~vdev_module( void_t ) ; this_ref_t operator = ( this_rref_t ) ; public: virtual void_t search( natus::device::imodule::search_funk_t ) ; virtual void_t update( void_t ) ; virtual void_t release( void_t ) noexcept ; public: typedef ::std::function< void_t ( natus::device::imapping_res_t ) > mapping_searach_ft ; void_t search( this_t::mapping_searach_ft ) ; void_t check_devices( natus::device::imodule_res_t ) ; private: void_t init_controller_1( natus::device::imodule_res_t ) ; } ; natus_res_typedef( vdev_module ) ; } }
[ "aconstlink@gmail.com" ]
aconstlink@gmail.com
aba9e186b901634845aac56f2fe54645b025e835
2481e88a5f14ccf51eb83a8556dd711c73c500f1
/ui_calculator.h
3e1744f49d4522971e5f98de02b14f35ec74ba38
[]
no_license
Saahil97/Qt-Calculator
1ec9d0d6d5e0b06a5a6534873644d749c354189e
e59caa1c63640c562ba0600aba831d55d05067fb
refs/heads/master
2020-05-05T13:33:28.233139
2019-04-08T06:40:35
2019-04-08T06:40:35
null
0
0
null
null
null
null
UTF-8
C++
false
false
14,399
h
/******************************************************************************** ** Form generated from reading UI file 'calculator.ui' ** ** Created by: Qt User Interface Compiler version 5.9.1 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ #ifndef UI_CALCULATOR_H #define UI_CALCULATOR_H #include <QtCore/QVariant> #include <QtWidgets/QAction> #include <QtWidgets/QApplication> #include <QtWidgets/QButtonGroup> #include <QtWidgets/QGridLayout> #include <QtWidgets/QHeaderView> #include <QtWidgets/QLineEdit> #include <QtWidgets/QMainWindow> #include <QtWidgets/QMenuBar> #include <QtWidgets/QPushButton> #include <QtWidgets/QStatusBar> #include <QtWidgets/QWidget> QT_BEGIN_NAMESPACE class Ui_calculator { public: QWidget *centralWidget; QGridLayout *gridLayout; QPushButton *Add; QPushButton *Button5; QPushButton *Button6; QPushButton *Button1; QPushButton *Button2; QPushButton *Button4; QPushButton *Button3; QPushButton *Button7; QPushButton *Button8; QPushButton *Multiply; QPushButton *Button9; QPushButton *Divide; QPushButton *Clear; QPushButton *Button0; QPushButton *Subtract; QLineEdit *Display; QPushButton *Equals; QMenuBar *menuBar; QStatusBar *statusBar; void setupUi(QMainWindow *calculator) { if (calculator->objectName().isEmpty()) calculator->setObjectName(QStringLiteral("calculator")); calculator->resize(400, 300); centralWidget = new QWidget(calculator); centralWidget->setObjectName(QStringLiteral("centralWidget")); gridLayout = new QGridLayout(centralWidget); gridLayout->setSpacing(6); gridLayout->setContentsMargins(11, 11, 11, 11); gridLayout->setObjectName(QStringLiteral("gridLayout")); Add = new QPushButton(centralWidget); Add->setObjectName(QStringLiteral("Add")); QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); sizePolicy.setHeightForWidth(Add->sizePolicy().hasHeightForWidth()); Add->setSizePolicy(sizePolicy); Add->setStyleSheet(QLatin1String("QPushButton{\n" " background-color:#FF8C00;\n" " border: 1px solid gray;\n" " padding: 5px;\n" "}\n" "\n" "QPushButton:pressed{\n" " background-color:#A9A9A9;\n" " border: 1px solid gray;\n" " padding: 5px;\n" "}")); gridLayout->addWidget(Add, 3, 3, 1, 1); Button5 = new QPushButton(centralWidget); Button5->setObjectName(QStringLiteral("Button5")); sizePolicy.setHeightForWidth(Button5->sizePolicy().hasHeightForWidth()); Button5->setSizePolicy(sizePolicy); Button5->setStyleSheet(QLatin1String("QPushButton{\n" " background-color:#C0C0C0;\n" " border: 1px solid gray;\n" " padding: 5px;\n" "}\n" "\n" "QPushButton:pressed{\n" " background-color:#A9A9A9;\n" " border: 1px solid gray;\n" " padding: 5px;\n" "}")); gridLayout->addWidget(Button5, 2, 1, 1, 1); Button6 = new QPushButton(centralWidget); Button6->setObjectName(QStringLiteral("Button6")); sizePolicy.setHeightForWidth(Button6->sizePolicy().hasHeightForWidth()); Button6->setSizePolicy(sizePolicy); Button6->setStyleSheet(QLatin1String("QPushButton{\n" " background-color:#C0C0C0;\n" " border: 1px solid gray;\n" " padding: 5px;\n" "}\n" "\n" "QPushButton:pressed{\n" " background-color:#A9A9A9;\n" " border: 1px solid gray;\n" " padding: 5px;\n" "}")); gridLayout->addWidget(Button6, 2, 2, 1, 1); Button1 = new QPushButton(centralWidget); Button1->setObjectName(QStringLiteral("Button1")); sizePolicy.setHeightForWidth(Button1->sizePolicy().hasHeightForWidth()); Button1->setSizePolicy(sizePolicy); Button1->setStyleSheet(QLatin1String("QPushButton{\n" " background-color:#C0C0C0;\n" " border: 1px solid gray;\n" " padding: 5px;\n" "}\n" "\n" "QPushButton:pressed{\n" " background-color:#A9A9A9;\n" " border: 1px solid gray;\n" " padding: 5px;\n" "}")); gridLayout->addWidget(Button1, 3, 0, 1, 1); Button2 = new QPushButton(centralWidget); Button2->setObjectName(QStringLiteral("Button2")); sizePolicy.setHeightForWidth(Button2->sizePolicy().hasHeightForWidth()); Button2->setSizePolicy(sizePolicy); Button2->setStyleSheet(QLatin1String("QPushButton{\n" " background-color:#C0C0C0;\n" " border: 1px solid gray;\n" " padding: 5px;\n" "}\n" "\n" "QPushButton:pressed{\n" " background-color:#A9A9A9;\n" " border: 1px solid gray;\n" " padding: 5px;\n" "}")); gridLayout->addWidget(Button2, 3, 1, 1, 1); Button4 = new QPushButton(centralWidget); Button4->setObjectName(QStringLiteral("Button4")); sizePolicy.setHeightForWidth(Button4->sizePolicy().hasHeightForWidth()); Button4->setSizePolicy(sizePolicy); Button4->setStyleSheet(QLatin1String("QPushButton{\n" " background-color:#C0C0C0;\n" " border: 1px solid gray;\n" " padding: 5px;\n" "}\n" "\n" "QPushButton:pressed{\n" " background-color:#A9A9A9;\n" " border: 1px solid gray;\n" " padding: 5px;\n" "}")); gridLayout->addWidget(Button4, 2, 0, 1, 1); Button3 = new QPushButton(centralWidget); Button3->setObjectName(QStringLiteral("Button3")); sizePolicy.setHeightForWidth(Button3->sizePolicy().hasHeightForWidth()); Button3->setSizePolicy(sizePolicy); Button3->setStyleSheet(QLatin1String("QPushButton{\n" " background-color:#C0C0C0;\n" " border: 1px solid gray;\n" " padding: 5px;\n" "}\n" "\n" "QPushButton:pressed{\n" " background-color:#A9A9A9;\n" " border: 1px solid gray;\n" " padding: 5px;\n" "}")); gridLayout->addWidget(Button3, 3, 2, 1, 1); Button7 = new QPushButton(centralWidget); Button7->setObjectName(QStringLiteral("Button7")); sizePolicy.setHeightForWidth(Button7->sizePolicy().hasHeightForWidth()); Button7->setSizePolicy(sizePolicy); Button7->setStyleSheet(QLatin1String("QPushButton{\n" " background-color:#C0C0C0;\n" " border: 1px solid gray;\n" " padding: 5px;\n" "}\n" "\n" "QPushButton:pressed{\n" " background-color:#A9A9A9;\n" " border: 1px solid gray;\n" " padding: 5px;\n" "}")); gridLayout->addWidget(Button7, 1, 0, 1, 1); Button8 = new QPushButton(centralWidget); Button8->setObjectName(QStringLiteral("Button8")); sizePolicy.setHeightForWidth(Button8->sizePolicy().hasHeightForWidth()); Button8->setSizePolicy(sizePolicy); Button8->setStyleSheet(QLatin1String("QPushButton{\n" " background-color:#C0C0C0;\n" " border: 1px solid gray;\n" " padding: 5px;\n" "}\n" "\n" "QPushButton:pressed{\n" " background-color:#A9A9A9;\n" " border: 1px solid gray;\n" " padding: 5px;\n" "}")); gridLayout->addWidget(Button8, 1, 1, 1, 1); Multiply = new QPushButton(centralWidget); Multiply->setObjectName(QStringLiteral("Multiply")); sizePolicy.setHeightForWidth(Multiply->sizePolicy().hasHeightForWidth()); Multiply->setSizePolicy(sizePolicy); Multiply->setStyleSheet(QLatin1String("QPushButton{\n" " background-color:#FF8C00;\n" " border: 1px solid gray;\n" " padding: 5px;\n" "}\n" "\n" "QPushButton:pressed{\n" " background-color:#A9A9A9;\n" " border: 1px solid gray;\n" " padding: 5px;\n" "}")); gridLayout->addWidget(Multiply, 2, 3, 1, 1); Button9 = new QPushButton(centralWidget); Button9->setObjectName(QStringLiteral("Button9")); sizePolicy.setHeightForWidth(Button9->sizePolicy().hasHeightForWidth()); Button9->setSizePolicy(sizePolicy); Button9->setStyleSheet(QLatin1String("QPushButton{\n" " background-color:#C0C0C0;\n" " border: 1px solid gray;\n" " padding: 5px;\n" "}\n" "\n" "QPushButton:pressed{\n" " background-color:#A9A9A9;\n" " border: 1px solid gray;\n" " padding: 5px;\n" "}")); gridLayout->addWidget(Button9, 1, 2, 1, 1); Divide = new QPushButton(centralWidget); Divide->setObjectName(QStringLiteral("Divide")); sizePolicy.setHeightForWidth(Divide->sizePolicy().hasHeightForWidth()); Divide->setSizePolicy(sizePolicy); Divide->setStyleSheet(QLatin1String("QPushButton{\n" " background-color:#FF8C00;\n" " border: 1px solid gray;\n" " padding: 5px;\n" "}\n" "\n" "QPushButton:pressed{\n" " background-color:#A9A9A9;\n" " border: 1px solid gray;\n" " padding: 5px;\n" "}")); gridLayout->addWidget(Divide, 1, 3, 1, 1); Clear = new QPushButton(centralWidget); Clear->setObjectName(QStringLiteral("Clear")); sizePolicy.setHeightForWidth(Clear->sizePolicy().hasHeightForWidth()); Clear->setSizePolicy(sizePolicy); Clear->setStyleSheet(QLatin1String("QPushButton{\n" " background-color:#C0C0C0;\n" " border: 1px solid gray;\n" " padding: 5px;\n" "}\n" "\n" "QPushButton:pressed{\n" " background-color:#A9A9A9;\n" " border: 1px solid gray;\n" " padding: 5px;\n" "}")); gridLayout->addWidget(Clear, 4, 0, 1, 1); Button0 = new QPushButton(centralWidget); Button0->setObjectName(QStringLiteral("Button0")); sizePolicy.setHeightForWidth(Button0->sizePolicy().hasHeightForWidth()); Button0->setSizePolicy(sizePolicy); Button0->setStyleSheet(QLatin1String("QPushButton{\n" " background-color:#C0C0C0;\n" " border: 1px solid gray;\n" " padding: 5px;\n" "}\n" "\n" "QPushButton:pressed{\n" " background-color:#A9A9A9;\n" " border: 1px solid gray;\n" " padding: 5px;\n" "}")); gridLayout->addWidget(Button0, 4, 1, 1, 1); Subtract = new QPushButton(centralWidget); Subtract->setObjectName(QStringLiteral("Subtract")); sizePolicy.setHeightForWidth(Subtract->sizePolicy().hasHeightForWidth()); Subtract->setSizePolicy(sizePolicy); Subtract->setStyleSheet(QLatin1String("QPushButton{\n" " background-color:#FF8C00;\n" " border: 1px solid gray;\n" " padding: 5px;\n" "}\n" "\n" "QPushButton:pressed{\n" " background-color:#A9A9A9;\n" " border: 1px solid gray;\n" " padding: 5px;\n" "}")); gridLayout->addWidget(Subtract, 4, 3, 1, 1); Display = new QLineEdit(centralWidget); Display->setObjectName(QStringLiteral("Display")); QSizePolicy sizePolicy1(QSizePolicy::Preferred, QSizePolicy::Expanding); sizePolicy1.setHorizontalStretch(0); sizePolicy1.setVerticalStretch(0); sizePolicy1.setHeightForWidth(Display->sizePolicy().hasHeightForWidth()); Display->setSizePolicy(sizePolicy1); QFont font; font.setFamily(QStringLiteral("MS PMincho")); font.setPointSize(28); Display->setFont(font); Display->setStyleSheet(QLatin1String("QLineEdit{\n" " background-color:gray;\n" " border: 1px solid gray;\n" " color: #ffffff;\n" "}")); Display->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); gridLayout->addWidget(Display, 0, 0, 1, 4); Equals = new QPushButton(centralWidget); Equals->setObjectName(QStringLiteral("Equals")); sizePolicy.setHeightForWidth(Equals->sizePolicy().hasHeightForWidth()); Equals->setSizePolicy(sizePolicy); Equals->setStyleSheet(QLatin1String("QPushButton{\n" " background-color:#rgb(180, 180, 180);\n" " border: 1px solid gray;\n" " padding: 5px;\n" "}\n" "\n" "QPushButton:pressed{\n" " background-color:#A9A9A9;\n" " border: 1px solid gray;\n" " padding: 5px;\n" "}")); gridLayout->addWidget(Equals, 4, 2, 1, 1); calculator->setCentralWidget(centralWidget); menuBar = new QMenuBar(calculator); menuBar->setObjectName(QStringLiteral("menuBar")); menuBar->setGeometry(QRect(0, 0, 400, 21)); calculator->setMenuBar(menuBar); statusBar = new QStatusBar(calculator); statusBar->setObjectName(QStringLiteral("statusBar")); calculator->setStatusBar(statusBar); retranslateUi(calculator); QMetaObject::connectSlotsByName(calculator); } // setupUi void retranslateUi(QMainWindow *calculator) { calculator->setWindowTitle(QApplication::translate("calculator", "calculator", Q_NULLPTR)); Add->setText(QApplication::translate("calculator", "+", Q_NULLPTR)); Button5->setText(QApplication::translate("calculator", "5", Q_NULLPTR)); Button6->setText(QApplication::translate("calculator", "6", Q_NULLPTR)); Button1->setText(QApplication::translate("calculator", "1", Q_NULLPTR)); Button2->setText(QApplication::translate("calculator", "2", Q_NULLPTR)); Button4->setText(QApplication::translate("calculator", "4", Q_NULLPTR)); Button3->setText(QApplication::translate("calculator", "3", Q_NULLPTR)); Button7->setText(QApplication::translate("calculator", "7", Q_NULLPTR)); Button8->setText(QApplication::translate("calculator", "8", Q_NULLPTR)); Multiply->setText(QApplication::translate("calculator", "*", Q_NULLPTR)); Button9->setText(QApplication::translate("calculator", "9", Q_NULLPTR)); Divide->setText(QApplication::translate("calculator", "/", Q_NULLPTR)); Clear->setText(QApplication::translate("calculator", "AC", Q_NULLPTR)); Button0->setText(QApplication::translate("calculator", "0", Q_NULLPTR)); Subtract->setText(QApplication::translate("calculator", "-", Q_NULLPTR)); Display->setText(QApplication::translate("calculator", "0.0", Q_NULLPTR)); Equals->setText(QApplication::translate("calculator", "=", Q_NULLPTR)); } // retranslateUi }; namespace Ui { class calculator: public Ui_calculator {}; } // namespace Ui QT_END_NAMESPACE #endif // UI_CALCULATOR_H
[ "noreply@github.com" ]
noreply@github.com
61758c5947bda60f7ba7de123985edb0d547183f
59636f543b56288f6e73379c020b89d5fbedafd0
/src/o2liteesp32.cpp
0e8385c6dbc7c16501975c3e15f9aedeb70302bb
[ "MIT" ]
permissive
vnorilo/o2
e1bf1f992d54b77540ab4b9b18ddc85b36fae435
dd9fad39267b8552b02ea980aaceb79693af78b6
refs/heads/master
2021-12-28T14:32:56.963948
2021-12-21T20:44:09
2021-12-21T20:44:09
127,145,836
0
1
null
2018-03-28T13:38:12
2018-03-28T13:38:12
null
UTF-8
C++
false
false
5,725
cpp
// o2liteesp32.c -- discovery implementation for ESP32 o2lite // // Roger B. Dannenberg // Aug 2021 // this also includes some o2lite functions that require C++ #include "o2lite.h" #include "Printable.h" #include "WiFi.h" #include <string.h> #include <mdns.h> //#include <lwip/sockets.h> //#include <lwip/netdb.h> //#include "esp32-hal.h" const int LED_PIN = 5; const int BUTTON_PIN = 0; void print_line() { printf("\n"); for (int i = 0; i < 30; i++) printf("-"); printf("\n"); } // manager for blinking the blue status light on ESP32 Thing // (for other ESP32 boards, we will have to change this or figure // out a compile-time switch to do the right thing.) // // Call this with the "status code" - a small integer controlling // how many blinks. // // Example sequence: if status is 2, blink_count is set to 4, and // blink_next is set to 250ms and LED is turned on // Time: 0 250 500 750 1500 ... // blink_count: 3 2 1 0 3 ... // LED: ON OFF ON OFF ON ... #define BLINK_PERIOD 250 int blink_count = 0; // countdown for how many blinks * 2 int blink_next = 0; // next time to do something void blink_init() { blink_next = millis(); blink_count = 0; pinMode(LED_PIN, OUTPUT); // ESP32 Thing specific output setup pinMode(BUTTON_PIN, INPUT_PULLUP); } // blink N flashes followed by longer interval. This does not // delay the caller much, but must be called repeatedly with // the same value of n. // // Prerequisite: caller must have recently called thing_blink_init() // void blink(int n) { if (blink_next > millis()) { return; } digitalWrite(LED_PIN, blink_count & 1); blink_next += BLINK_PERIOD; if (blink_count == 0) { blink_count = (n << 1); blink_next += (BLINK_PERIOD << 1); } blink_count--; } // quick flash -- delays caller by 100ms // repeated calls may just appear to stuck on void flash() { digitalWrite(LED_PIN, HIGH); delay(100); digitalWrite(LED_PIN, LOW); } #ifdef O2LDEBUG void button_poll() { verbose = (digitalRead(BUTTON_PIN) == LOW); } #endif void connect_to_wifi(const char *hostname, const char *ssid, const char *pwd) { blink_init(); print_line(); printf("Connecting to WiFi network: %s\n", ssid); WiFi.begin(ssid, pwd); WiFi.setHostname(hostname); while (WiFi.status() != WL_CONNECTED) { blink(1); // Blink LED while we're connecting: } uint32_t ip = WiFi.localIP(); ip = htonl(ip); snprintf(o2n_internal_ip, O2N_IP_LEN, "%08x", ip); char dot_ip[O2N_IP_LEN]; o2_hex_to_dot(o2n_internal_ip, dot_ip); printf("\nWiFi connected! IP address: %s (%s)\n", o2n_internal_ip, dot_ip); } #ifndef O2_NO_ZEROCONF // assumes connect_to_wifi has been called already. int o2ldisc_init(const char *ensemble) { o2l_ensemble = ensemble; //initialize mDNS service esp_err_t err = mdns_init(); if (err) { printf("ERROR: mdns_init() failed: %d\n", err); return O2L_FAIL; } //set hostname mdns_hostname_set("o2esp32"); //set default instance mdns_instance_name_set("O2 ESP32"); return O2L_SUCCESS; } int check_for_proc(const char *proc_name, const char *vers_num, char *internal_ip, int port, int *udp_send_port) { // names are fixed length -- reject if invalid if (!proc_name || strlen(proc_name) != 28) { return -1; } O2LDB printf("o2lite: discovered name=%s\n", proc_name); if (!o2l_is_valid_proc_name(proc_name, port, internal_ip, udp_send_port)) { return -1; } int version; O2LDB if (vers_num) { printf(" discovered vers=%s\n", vers_num); } if (!vers_num || (version = o2l_parse_version(vers_num, strlen(vers_num)) == 0)) { return -1; } return 0; } void o2ldisc_poll() { static int resolve_timeout = 0; // start as soon as possible O2LDB button_poll(); O2LDBV printf("tcp_sock %d\n", tcp_sock); if (tcp_sock != INVALID_SOCKET) { return; } if (o2l_local_now < resolve_timeout) { blink(2); // 2 means waiting to find an O2 host return; } mdns_result_t *results = NULL; flash(); esp_err_t err = mdns_query_ptr("_o2proc", "_tcp", 3000, 20, &results); blink_init(); // since time has passed, reset blink state resolve_timeout = o2l_local_time() + 2.0; // 2s before we try again if (err) { printf("ERROR: mdns_query_ptr Failed: %d\n", err); return; } if (!results) { return; } mdns_result_t *r = results; while (r) { const char *proc_name = NULL; const char *vers_num = NULL; char internal_ip[O2N_IP_LEN]; int udp_port; if (!r->instance_name || !streql(r->instance_name, o2l_ensemble) || !r->txt_count) { continue; } for (int i = 0; i < r->txt_count; i++) { if (streql(r->txt[i].key, "name")) { proc_name = r->txt[i].value; } if (streql(r->txt[i].key, "vers")) { vers_num = r->txt[i].value; } } if (check_for_proc(proc_name, vers_num, internal_ip, r->port, &udp_port) < 0) { continue; } char iip_dot[16]; o2_hex_to_dot(internal_ip, iip_dot); o2l_address_init(&udp_server_sa, iip_dot, udp_port, false); o2l_address_init(&udp_server_sa, iip_dot, udp_port, false); o2l_network_connect(iip_dot, r->port); break; } mdns_query_results_free(results); } void o2ldisc_events(fd_set *read_set_ptr) { return; } #endif
[ "rbd@cs.cmu.edu" ]
rbd@cs.cmu.edu
7216a9233891872af4c08f8a92145ee4be78dd11
813bdcdc2e7c9fbf853b154585c4c2b1cfe9eb4b
/LCD6963C.CPP
87ab9e86105b92c69e4c457d85422b2b18f9c410
[]
no_license
Rubyrohd/LCD6963C
24a7c585a63b4ffb319a7e3e10482f515e5c2273
dbfd47f971b75d77f4e84e74c01765e842a242fb
refs/heads/master
2021-04-26T22:30:16.910954
2018-03-06T20:17:25
2018-03-06T20:17:25
124,102,471
0
0
null
null
null
null
UTF-8
C++
false
false
138
cpp
#include "Arduino.h" #include "LCD6963C.h" LCD6963C::LCD6963C() { //constructor } void LCD6963C::init() { //display initialization }
[ "development@brutaldesign.dk" ]
development@brutaldesign.dk
3e00930584d40e2d958c0edb5f30ea6da2c45156
8a38398f6d81113652a36987bede7e46453edd52
/BiLSTM-ChaoWang/bilstm.cpp
995e70e9226bc5503b31693d49eecec2e3d0df82
[]
no_license
andyhx/2016DL
6989f0a3727b9e8c9c7141b24f32151c604b7666
87f9c7af6447a1cc63a5098acfce8a40073e208a
refs/heads/master
2020-12-30T11:40:43.182087
2016-11-14T01:26:36
2016-11-14T01:26:36
null
0
0
null
null
null
null
UTF-8
C++
false
false
52,200
cpp
#include <iostream> #include <utility> #include <math.h> #include <stdlib.h> #include <string> #include <algorithm> #include <cfloat> #include <vector> #include <fstream> //#include "util.h" using namespace std; typedef vector< vector<double> > D2array; //二维数组 typedef vector<double> D1array; /* bidrectional lstm * * */ double sigmoid(double x) { return 1.0 / (1.0 + exp(-x)); }; double tanh(double x) { return 2.0 * 1.0 / (1.0 + exp(-2.0 * x)) - 1.0; }; double dsigmoid(float x) { return (1.0 / (1.0 + exp(-x))) * (1 - 1.0 / (1.0 + exp(-x))); }; double dtanh(float x) { return 1 - pow((2.0 * 1.0 / (1.0 + exp(-2.0 * x)) - 1.0),2); }; /***************************************************************************************************/ //fill weights double gaussian(float mean, float variance) { static double V1, V2, S; static int phase = 0; double X; if ( phase == 0 ) { do { double U1 = (double)rand() / RAND_MAX; double U2 = (double)rand() / RAND_MAX; V1 = 2 * U1 - 1; V2 = 2 * U2 - 1; S = V1 * V1 + V2 * V2; } while(S >= 1 || S == 0); X = V1 * sqrt(-2 * log(S) / S); } else X = V2 * sqrt(-2 * log(S) / S); X = X * variance + mean; phase = 1 - phase; return X; }; /* init weights void init_weights() { //method of guassian for(int d = 0; d < H_; ++d) { //cell weights c_weight_i[d] = gaussian(0, 0.1); c_weight_f[d] = gaussian(0, 0.1); c_weight_o[d] = gaussian(0, 0.1); for(int i = 0; i < I_; ++i) { weight_i[d][i] = gaussian(0, 0.1); weight_f[d][i] = gaussian(0, 0.1); weight_g[d][i] = gaussian(0, 0.1); weight_o[d][i] = gaussian(0, 0.1); } for(int j = 0; j < H_; ++j) { h_weight_i[d][j] = gaussian(0, 0.1); h_weight_f[d][j] = gaussian(0, 0.1); h_weight_g[d][j] = gaussian(0, 0.1); h_weight_o[d][j] = gaussian(0, 0.1); } } } */ //softmax double softmax(double *x) { double max = 0.0; double sum = 0.0; for(int i = 0; i<8; ++i) if(max < x[i]) max = x[i]; for(int j = 0; j<8; ++j) { x[j] = exp(x[j] - max); sum += x[j]; } for(int l = 0; l<8; ++l) x[l] /=sum; } //shuffle void perfect_shuffle(int *a,int n) { int t,i; if (n == 1) { t = a[1]; a[1] = a[2]; a[2] = t; return; } int n2 = n * 2, n3 = n / 2; if (n % 2 == 1) //奇数的处理 { t = a[n]; for (i = n + 1; i <= n2; ++i) { a[i - 1] = a[i]; } a[n2] = t; --n; } //到此n是偶数 for (i = n3 + 1; i <= n; ++i) { t = a[i]; a[i] = a[i + n3]; a[i + n3] = t; } // [1.. n /2] perfect_shuffle(a, n3); perfect_shuffle(a + n, n3); } //bidirectional LSTM int main() { /* int input_units = 6; int hidden_units = 10; int output_units = 8; int n_samples = 8; int steps=300; */ /* double x[2400][6]; float y[8] = {0,1,2,3,4,5,6}; for(int m = 0; m < 2400; ++m) { for(int n = 0; n < 6; ++n) { x[m][n] = gaussian(1, 0.1); } } */ int H_ = 100; // hidden units int I_ = 6; // input units int T_ = 300; // steps int N_ = 64; //samples int K_ = 8; // output units float lr=0.0001; int batch_count = 1; int batch_size = 1; float best_accury = 0.0; //save the best modle //forward layer double f_weight_i[H_][I_]; //num of cell block double f_weight_f[H_][I_]; double f_weight_g[H_][I_]; //candidate state double f_weight_o[H_][I_]; double f_h_weight_i[H_][H_]; double f_h_weight_f[H_][H_]; double f_h_weight_g[H_][H_]; double f_h_weight_o[H_][H_]; double f_c_weight_i[H_]; double f_c_weight_f[H_]; double f_c_weight_o[H_]; double f_h_z_weight[K_][H_]; // hidden to output double f_bias_i[H_]; // forward bias double f_bias_f[H_]; double f_bias_g[H_]; double f_bias_o[H_]; double f_c_t[T_][H_]; //forward double f_h_t[T_][H_]; double f_net_i[T_][H_]; double f_net_f[T_][H_]; double f_net_g[T_][H_]; double f_net_o[T_][H_]; double f_gate_i[T_][H_]; double f_gate_f[T_][H_]; double f_state_g[T_][H_]; double f_gate_o[T_][H_]; double f_h_prev[H_]; double f_c_prev[H_]; double f_c_state_diff[T_][H_]; double f_g_gate_diff[T_][H_]; double f_f_gate_diff[T_][H_]; double f_i_gate_diff[T_][H_]; double f_o_gate_diff[T_][H_]; double f_h_gate_diff[T_][H_]; //cell output diff double f_h_i_gate_diff[T_][H_]; // to compute h_gate_diff double f_h_f_gate_diff[T_][H_]; double f_h_g_gate_diff[T_][H_]; double f_h_o_gate_diff[T_][H_]; double f_o_h_diff[T_][K_]; //backward layer double b_weight_i[H_][I_]; //input to i f g o double b_weight_f[H_][I_]; double b_weight_g[H_][I_]; //candidate state double b_weight_o[H_][I_]; double b_h_weight_i[H_][H_]; // hidden to hidden double b_h_weight_f[H_][H_]; double b_h_weight_g[H_][H_]; double b_h_weight_o[H_][H_]; //cell weughts double b_c_weight_i[H_]; double b_c_weight_f[H_]; double b_c_weight_o[H_]; double b_h_z_weight[K_][H_]; // hidden to output double b_bias_i[H_]; // backward layer bias double b_bias_f[H_]; double b_bias_g[H_]; double b_bias_o[H_]; double b_c_t[T_][H_]; //backward layer double b_h_t[T_][H_]; double b_net_i[T_][H_]; double b_net_f[T_][H_]; double b_net_g[T_][H_]; double b_net_o[T_][H_]; double b_gate_i[T_][H_]; double b_gate_f[T_][H_]; double b_state_g[T_][H_]; double b_gate_o[T_][H_]; double b_h_prev[H_]; double b_c_prev[H_]; double b_c_state_diff[T_][H_]; double b_g_gate_diff[T_][H_]; double b_f_gate_diff[T_][H_]; double b_i_gate_diff[T_][H_]; double b_o_gate_diff[T_][H_]; double b_h_gate_diff[T_][H_]; //cell output diff double b_h_i_gate_diff[T_][H_]; // to compute h_gate_diff double b_h_f_gate_diff[T_][H_]; double b_h_g_gate_diff[T_][H_]; double b_h_o_gate_diff[T_][H_]; double b_o_h_diff[T_][K_]; //weights saved for test when test accuary > best_accuary; double save_weight_i[H_][I_]; //num of cell block double save_weight_f[H_][I_]; double save_weight_g[H_][I_]; //candidate state double save_weight_o[H_][I_]; double save_h_weight_i[H_][H_]; //hidden to hidden weights double save_h_weight_f[H_][H_]; double save_h_weight_g[H_][H_]; double save_h_weight_o[H_][H_]; double save_c_weight_i[H_]; //cell block weights double save_c_weight_f[H_]; double save_c_weight_o[H_]; double save_bias_i[H_]; // bias saved double save_bias_f[H_]; double save_bias_g[H_]; double save_bias_o[H_]; double save_bias_z[K_]; //output layer double bias_z[K_]; //bias of hidden to output double z_o[T_][K_]; //output layer //for test double z_o_test[T_][K_]; double z_[K_]; double z_test[K_]; double *ip = z_; double *test_ip = z_test; double f_error[T_][H_]; double b_error[T_][H_]; double gradient_O_h[T_][K_]; double softmax_o[T_][K_]; double softmax_loss[T_][K_]; double loss; //double elapsed_time; //compute time of a iteration double sum = 0; // data int row = 19200; int col = 6; int count = 0; int y[64]; int y_test[64]; int id[64]; //double x[row][col]; //float out[row][col]; int label = 0; for(int i = 0; i<64; i++) { y[i] = label; id[i] = i; y_test[i] = label; if((i+1)%8 == 0) label++; //cout << id[i] << endl; } ifstream input_train("nn_train.txt");//打开输入文件 载入训练数据 ifstream input_test("nn_test.txt"); //载入测试数据 cout << "error2" << endl; //ofstream output("E:\\c++\\C++ code\\item_basedCF\\mytext.txt"); //打开要写入的文件,如果该文件不存在,则自动 D2array x(row, D1array (col, 0)); //声明一个二维数组,将读入的数据写入该数组 D2array x_test(row, D1array (col, 0)); if (!input_train.is_open()) //如果文件打开失败 { cout << "File is not existing!" << endl; exit(1); } if (!input_test.is_open()) //如果文件打开失败 { cout << "File is not existing!" << endl; exit(1); } for (int i = 0; i < row; ++i) { for (int j = 0; j < col; j++) { input_train >> x[i][j]; //从输入流对象input读取字符到out input_test >> x_test[i][j]; //cout << x_test[i][j] << " "; //x[i][j] = out[i][j]; count++; } //cout << " " << endl; //output << endl; } //cout << "count is 19200" << endl; //cout << count << endl; input_train.close(); input_test.close(); // init weights for(int d = 0; d < H_; ++d) { //cell weights f_c_weight_i[d] = gaussian(0, 0.1); f_c_weight_f[d] = gaussian(0, 0.1); f_c_weight_o[d] = gaussian(0, 0.1); b_c_weight_i[d] = gaussian(0, 0.1); b_c_weight_f[d] = gaussian(0, 0.1); b_c_weight_o[d] = gaussian(0, 0.1); f_bias_i[d] = 0; f_bias_f[d] = 0; f_bias_g[d] = 0; f_bias_o[d] = 0; b_bias_i[d] = 0; b_bias_f[d] = 0; b_bias_g[d] = 0; b_bias_o[d] = 0; for(int i = 0; i < I_; ++i) { f_weight_i[d][i] = gaussian(0, 0.1); f_weight_f[d][i] = gaussian(0, 0.1); f_weight_g[d][i] = gaussian(0, 0.1); f_weight_o[d][i] = gaussian(0, 0.1); b_weight_i[d][i] = gaussian(0, 0.1); b_weight_f[d][i] = gaussian(0, 0.1); b_weight_g[d][i] = gaussian(0, 0.1); b_weight_o[d][i] = gaussian(0, 0.1); } for(int j = 0; j < H_; ++j) { f_h_weight_i[d][j] = gaussian(0, 0.1); f_h_weight_f[d][j] = gaussian(0, 0.1); f_h_weight_g[d][j] = gaussian(0, 0.1); f_h_weight_o[d][j] = gaussian(0, 0.1); b_h_weight_i[d][j] = gaussian(0, 0.1); b_h_weight_f[d][j] = gaussian(0, 0.1); b_h_weight_g[d][j] = gaussian(0, 0.1); b_h_weight_o[d][j] =gaussian(0, 0.1); } //previous state for(int k = 0; k < K_; ++k) { f_h_z_weight[k][d] = gaussian(0, 0.1); b_h_z_weight[k][d] = gaussian(0, 0.1); } } // initialize h_prev[] for(int h = 0; h < H_; ++h) { f_h_prev[h] = 0; f_c_prev[h] = 0; b_h_prev[h] = 0; b_c_prev[h] = 0; } int max_epoch = 200; // or for(int epoch = 0; epoch < max_epoch; ++epoch) { cout << epoch << " epochs" << endl; //elapsed_time = omp_get_wtime(); perfect_shuffle(id, 31); perfect_shuffle(id, 31); perfect_shuffle(y, 31); perfect_shuffle(y, 31); for(int n = 0; n < N_; ++n) { //cout << n << " iteration" << endl; // forwardpass of forward hidden layer for(int t = 0; t < T_; ++t) // T_ step { //previous state for(int d = 0; d < H_; ++d) // H_:hidden units { // in, forget, g_sate, output // compute like MLP //cout << d << "hidden unit" << (n * T_ + t) << "x_input" << endl; for(int i = 0; i < I_; ++i) { f_net_i[t][d] += f_weight_i[d][i] * x[id[n] * T_ + t][i] ; f_net_f[t][d] += f_weight_f[d][i] * x[id[n] * T_ + t][i] ; f_net_g[t][d] += f_weight_g[d][i] * x[id[n] * T_ + t][i] ; f_net_o[t][d] += f_weight_o[d][i] * x[id[n] * T_ + t][i] ; //cout << id[n] << " id and label " << y[n] << endl; // test this block of code, x_input and bias are ok, weight_update is the problem } // !!! input is ok // sum the h(t-1) state; prev output的处理上应该存在问题 for(int j = 0; j < H_; ++j) { f_net_i[t][d] += f_h_weight_i[d][j] * f_h_prev[j]; f_net_f[t][d] += f_h_weight_f[d][j] * f_h_prev[j]; f_net_g[t][d] += f_h_weight_g[d][j] * f_h_prev[j]; f_net_o[t][d] += f_h_weight_o[d][j] * f_h_prev[j]; //std::cout << "h_prev" << h_prev[j] << "h_t" << h_t[t][j] << endl; } //sum c(t-1) f_net_i[t][d] += f_c_weight_i[d] * f_c_prev[d]; f_net_f[t][d] += f_c_weight_f[d] * f_c_prev[d]; //compute input gate, forget gate, candiate cell state, output gate f_gate_i[t][d] = sigmoid(f_net_i[t][d] + f_bias_i[d]);//input gate f_gate_f[t][d] = sigmoid(f_net_f[t][d] + f_bias_f[d]);//forget gate f_state_g[t][d] = tanh(f_net_g[t][d] + f_bias_g[d]); //cell output f_c_t[t][d] = f_gate_f[t][d] * f_c_prev[d] + f_gate_i[t][d] * f_state_g[t][d]; f_net_o[t][d] += f_c_weight_o[d] * f_c_t[t][d]; // output gate 多了一项c_t[t][d] // gate_o[t][d] = sigmoid(net_o[t][d] + c_t[t][d]); f_gate_o[t][d] = sigmoid(f_net_o[t][d] + f_bias_o[d]);//output gate //cell netoutput one time step f_h_t[t][d] = f_gate_o[t][d] * tanh(f_c_t[t][d]); //cell output //cout << "h_t out" << h_t[t][d] << endl; } //update prev h&c for(int d=0; d<H_; ++d) { f_h_prev[d] = f_h_t[t][d]; f_c_prev[d] = f_c_t[t][d]; } } //forward pass of backward hidden layer for(int t = T_-1; t >= 0; --t) // T_ step { //previous state for(int d = 0; d < H_; ++d) // H_:hidden units { // in, forget, g_sate, output // compute like MLP //cout << d << "hidden unit" << (n * T_ + t) << "x_input" << endl; for(int i = 0; i < I_; ++i) { b_net_i[t][d] += b_weight_i[d][i] * x[id[n] * T_ + t][i] ; b_net_f[t][d] += b_weight_f[d][i] * x[id[n] * T_ + t][i] ; b_net_g[t][d] += b_weight_g[d][i] * x[id[n] * T_ + t][i] ; b_net_o[t][d] += b_weight_o[d][i] * x[id[n] * T_ + t][i] ; //cout << id[n] << " id and label " << y[n] << endl; // test this block of code, x_input and bias are ok, weight_update is the problem } // !!! input is ok // sum the h(t-1) state; prev output的处理上应该存在问题 for(int j = 0; j < H_; ++j) { b_net_i[t][d] += b_h_weight_i[d][j] * b_h_prev[j]; b_net_f[t][d] += b_h_weight_f[d][j] * b_h_prev[j]; b_net_g[t][d] += b_h_weight_g[d][j] * b_h_prev[j]; b_net_o[t][d] += b_h_weight_o[d][j] * b_h_prev[j]; //std::cout << "h_prev" << h_prev[j] << "h_t" << h_t[t][j] << endl; } //sum c(t-1) b_net_i[t][d] += b_c_weight_i[d] * b_c_prev[d]; b_net_f[t][d] += b_c_weight_f[d] * b_c_prev[d]; //compute input gate, forget gate, candiate cell state, output gate b_gate_i[t][d] = sigmoid(b_net_i[t][d] + b_bias_i[d]);//input gate b_gate_f[t][d] = sigmoid(b_net_f[t][d] + b_bias_f[d]);//forget gate b_state_g[t][d] = tanh(b_net_g[t][d] + b_bias_g[d]); //cell output b_c_t[t][d] = b_gate_f[t][d] * b_c_prev[d] + b_gate_i[t][d] * b_state_g[t][d]; b_net_o[t][d] += b_c_weight_o[d] * b_c_t[t][d]; // output gate 多了一项c_t[t][d] // gate_o[t][d] = sigmoid(net_o[t][d] + c_t[t][d]); b_gate_o[t][d] = sigmoid(b_net_o[t][d] + b_bias_o[d]);//output gate //cell netoutput one time step b_h_t[t][d] = b_gate_o[t][d] * tanh(b_c_t[t][d]); //cell output //cout << "h_t out" << h_t[t][d] << endl; } //update prev h&c for(int d=0; d<H_; ++d) { b_h_prev[d] = b_h_t[t][d]; b_c_prev[d] = b_c_t[t][d]; } } // forward is ok 未出现 core dumped // compute // output layer for(int t=0; t<T_; ++t) { //std::cout << t <<"step" << std::endl; for(int f = 0; f < K_; ++f) { for(int h = 0; h < H_; ++h) { z_o[t][f] += f_h_z_weight[f][h] * f_h_t[t][h] + b_h_z_weight[f][h] * b_h_t[t][h]; } z_o[t][f] = z_o[t][f] + bias_z[f]; z_[f] = z_o[t][f]; //cout << f << " bias_z:" << bias_z[f] << "z_o" << z_[f] << std::endl; //at time step computesoftmax } softmax(z_); for(int f = 0; f < K_; ++f) { softmax_o[t][f] = *ip; sum += softmax_o[t][f]; //std::cout << "the probability of" << f << "output units:" << " " // << "lable" <<id[n]/8 << " " // << softmax_o[t][f] << std::endl; ip++; softmax_loss[t][f] = -log(softmax_o[t][f]); } //std::cout << "sum" << std::endl; //std::cout << sum << std::endl; sum = 0; for(int k = 0; k < K_; ++k) { loss += softmax_loss[t][k]; } ip = z_; //num++; } //cout << "loss" << endl; //cout << loss << endl; // before backward is ok 程序可以执行到此处 //forward layer Backward pass for( int t = T_-1; t >= 0; --t) { //compute error, T step , cell outputs for(int h = 0; h < H_; ++h) { for(int k =0; k<K_; ++k) { if(y[id[n]] == k) { f_error[t][h] += f_h_z_weight[k][h]*(softmax_o[t][k] - 1); //cout << "compute" << endl; } else { f_error[t][h] += f_h_z_weight[k][h] * softmax_o[t][k]; } } } for(int k = 0; k<K_; ++k) { if(y[id[n]] == k) { gradient_O_h[t][k] = softmax_o[t][k] - 1; } else { gradient_O_h[t][k] = softmax_o[t][k]; } } for(int d = 0; d < H_; ++d) { //float error = h_t[t][d] - y[t][d]; //float dEdo = tanh(c_t[t][H_-d]); //error += (z_o[t][k] - y[k]) * h_z_weight[K_][H_]; //float dEdc = gate_t[2*H_ + d] * (1 - pow(tanh(c_t[t][H_-d])),2); //E[H_-d] = 0.5 * pow(error, 2); //follow Graves if( t==T_) { // cell state // cell output is error //cell outputs f_h_i_gate_diff[t][d] = 0; f_h_f_gate_diff[t][d] = 0; f_h_g_gate_diff[t][d] = 0; f_h_o_gate_diff[t][d] = 0; f_h_gate_diff[t][d] = f_error[t][d] + f_h_i_gate_diff[t][d] + f_h_f_gate_diff[t][d] + f_h_g_gate_diff[t][d] + f_h_o_gate_diff[t][d]; //output gates f_o_gate_diff[t][d] = dsigmoid(f_net_o[t][d]) * f_h_gate_diff[t][d] * tanh(f_gate_o[t][d]); //cell state f_c_state_diff[t][d] = f_gate_o[t][d] * dtanh(f_c_t[t][d]) * f_h_gate_diff[t][d] + f_c_weight_o[d]*f_o_gate_diff[t][d] ; //candidate cell state f_g_gate_diff[t][d] = f_gate_i[t][d] * dtanh(f_state_g[t][d]) * f_c_state_diff[t][d]; //forget gate f_f_gate_diff[t][d] = dsigmoid(f_net_f[t][d]) * f_c_t[t-1][d] * f_c_state_diff[t][d]; //公式没有错误。。。 //input gate f_i_gate_diff[t][d] = dsigmoid(f_net_i[t][d]) * f_c_state_diff[t][d] * f_state_g[t][d]; // input 有一个错误,dsigmoid应为net_i // 改进该错误之后,c_weight 爆炸没有那么 // 快了 32sample 为nan } else { // T-1 then diff //cell outputs for(int hi = 0; hi < H_; ++hi) { f_h_i_gate_diff[t][d] += f_error[t+1][d] * f_gate_o[t+1][d] * dtanh(f_c_t[t+1][d]) * f_state_g[t+1][d] * dsigmoid(f_net_i[t+1][d]) * f_h_weight_i[d][hi]; f_h_f_gate_diff[t][d] += f_error[t+1][d] * f_gate_o[t+1][d] * dtanh(f_c_t[t+1][d]) * f_c_t[t][d] * dsigmoid(f_net_f[t+1][d]) * f_h_weight_f[d][hi]; f_h_g_gate_diff[t][d] += f_error[t+1][d] * f_gate_o[t+1][d] * dtanh(f_c_t[t+1][d]) * f_gate_i[t+1][d] * dtanh(f_net_g[t+1][d]) * f_h_weight_g[d][hi]; f_h_o_gate_diff[t][d] += f_error[t+1][d] * tanh(f_c_t[t+1][d]) * dsigmoid(f_gate_o[t+1][d]) * f_h_weight_o[d][hi]; } f_h_gate_diff[t][d] = f_error[t][d] + f_h_i_gate_diff[t][d] + f_h_f_gate_diff[t][d] + f_h_g_gate_diff[t][d] + f_h_o_gate_diff[t][d]; //output gate f_o_gate_diff[t][d] = dsigmoid(f_net_o[t][d]) * f_h_gate_diff[t][d] * tanh(f_gate_o[t][d]); //cell state f_c_state_diff[t][d] = f_gate_o[t][d] * dtanh(f_c_t[t][d]) * f_error[t][d] + f_gate_f[t+1][d] * f_c_state_diff[t+1][d] + f_c_weight_i[d] * f_i_gate_diff[t+1][d] + f_c_weight_f[d] * f_f_gate_diff[t+1][d] + f_c_weight_o[d] * f_o_gate_diff[t][d]; //candidate cell state f_g_gate_diff[t][d] = f_gate_i[t][d] * dtanh(f_state_g[t][d]) * f_c_state_diff[t][d]; //forget gate f_f_gate_diff[t][d] = dsigmoid(f_net_f[t][d]) * f_c_t[t-1][d] * f_c_state_diff[t][d]; //input gate f_i_gate_diff[t][d] = dsigmoid(f_net_i[t][d]) * f_c_state_diff[t][d] * f_state_g[t][d]; } } } //backward layer for backward pass for( int t = 0; t < T_; ++t) { //compute error, T step , cell outputs for(int h = 0; h < H_; ++h) { for(int k =0; k<K_; ++k) { if(y[id[n]] == k) { b_error[t][h] += b_h_z_weight[k][h]*(softmax_o[t][k] - 1); //cout << "compute" << endl; } else { b_error[t][h] += b_h_z_weight[k][h] * softmax_o[t][k]; } } } for(int k = 0; k<K_; ++k) { if(y[id[n]] == k) { gradient_O_h[t][k] = softmax_o[t][k] - 1; } else { gradient_O_h[t][k] = softmax_o[t][k]; } } for(int d = 0; d < H_; ++d) { //float error = h_t[t][d] - y[t][d]; //float dEdo = tanh(c_t[t][H_-d]); //error += (z_o[t][k] - y[k]) * h_z_weight[K_][H_]; //float dEdc = gate_t[2*H_ + d] * (1 - pow(tanh(c_t[t][H_-d])),2); //E[H_-d] = 0.5 * pow(error, 2); //follow Graves if( t==T_) { // cell state // cell output is error //cell outputs b_h_i_gate_diff[t][d] = 0; b_h_f_gate_diff[t][d] = 0; b_h_g_gate_diff[t][d] = 0; b_h_o_gate_diff[t][d] = 0; b_h_gate_diff[t][d] = b_error[t][d] + b_h_i_gate_diff[t][d] + b_h_f_gate_diff[t][d] + b_h_g_gate_diff[t][d] + b_h_o_gate_diff[t][d]; //output gates b_o_gate_diff[t][d] = dsigmoid(b_net_o[t][d]) * b_h_gate_diff[t][d] * tanh(b_gate_o[t][d]); //cell state b_c_state_diff[t][d] = b_gate_o[t][d] * dtanh(b_c_t[t][d]) * b_h_gate_diff[t][d] + b_c_weight_o[d]*b_o_gate_diff[t][d] ; //candidate cell state b_g_gate_diff[t][d] = b_gate_i[t][d] * dtanh(b_state_g[t][d]) * b_c_state_diff[t][d]; //forget gate b_f_gate_diff[t][d] = dsigmoid(b_net_f[t][d]) * b_c_t[t-1][d] * b_c_state_diff[t][d]; //公式没有错误。。。 //input gate b_i_gate_diff[t][d] = dsigmoid(b_net_i[t][d]) * b_c_state_diff[t][d] * b_state_g[t][d]; // input 有一个错误,dsigmoid应为net_i // 改进该错误之后,c_weight 爆炸没有那么 // 快了 32sample 为nan } else { // T-1 then diff //cell outputs for(int hi = 0; hi < H_; ++hi) { b_h_i_gate_diff[t][d] += b_error[t+1][d] * b_gate_o[t+1][d] * dtanh(b_c_t[t+1][d]) * b_state_g[t+1][d] * dsigmoid(b_net_i[t+1][d]) * b_h_weight_i[d][hi]; b_h_f_gate_diff[t][d] += b_error[t+1][d] * b_gate_o[t+1][d] * dtanh(b_c_t[t+1][d]) * b_c_t[t][d] * dsigmoid(b_net_f[t+1][d]) * b_h_weight_f[d][hi]; b_h_g_gate_diff[t][d] += b_error[t+1][d] * b_gate_o[t+1][d] * dtanh(b_c_t[t+1][d]) * b_gate_i[t+1][d] * dtanh(b_net_g[t+1][d]) * b_h_weight_g[d][hi]; b_h_o_gate_diff[t][d] += b_error[t+1][d] * tanh(b_c_t[t+1][d]) * dsigmoid(b_gate_o[t+1][d]) * b_h_weight_o[d][hi]; } b_h_gate_diff[t][d] = b_error[t][d] + b_h_i_gate_diff[t][d] + b_h_f_gate_diff[t][d] + b_h_g_gate_diff[t][d] + b_h_o_gate_diff[t][d]; //output gate b_o_gate_diff[t][d] = dsigmoid(b_net_o[t][d]) * b_h_gate_diff[t][d] * tanh(b_gate_o[t][d]); //cell state b_c_state_diff[t][d] = b_gate_o[t][d] * dtanh(b_c_t[t][d]) * b_error[t][d] + b_gate_f[t+1][d] * b_c_state_diff[t+1][d] + b_c_weight_i[d] * b_i_gate_diff[t+1][d] + b_c_weight_f[d] * b_f_gate_diff[t+1][d] + b_c_weight_o[d] * b_o_gate_diff[t][d]; //candidate cell state b_g_gate_diff[t][d] = b_gate_i[t][d] * dtanh(b_state_g[t][d]) * b_c_state_diff[t][d]; //forget gate b_f_gate_diff[t][d] = dsigmoid(b_net_f[t][d]) * b_c_t[t-1][d] * b_c_state_diff[t][d]; //input gate b_i_gate_diff[t][d] = dsigmoid(b_net_i[t][d]) * b_c_state_diff[t][d] * b_state_g[t][d]; } } } //batch_count++; // before update is ok (core dumped problem) if(batch_count == batch_size) // version of batch = 1 { // update weights and bias batch_count = 0; // cout << n << "sample:" << " " <<endl ; for(int t = T_ - 1; t >= 0; --t) { // cout << t << "steps:" << " " <<endl ; for(int d = 0; d < H_; ++d) { f_c_weight_i[d] = f_c_weight_i[d] - lr * f_i_gate_diff[t][d] * f_c_t[t-1][d]; f_c_weight_f[d] = f_c_weight_f[d] - lr * f_f_gate_diff[t][d] * f_c_t[t-1][d]; f_c_weight_o[d] = f_c_weight_o[d] - lr * f_g_gate_diff[t][d] * f_c_t[t][d]; b_c_weight_i[d] = b_c_weight_i[d] - lr * b_i_gate_diff[t][d] * b_c_t[t-1][d]; b_c_weight_f[d] = b_c_weight_f[d] - lr * b_f_gate_diff[t][d] * b_c_t[t-1][d]; b_c_weight_o[d] = b_c_weight_o[d] - lr * b_g_gate_diff[t][d] * b_c_t[t][d]; //cout << "c_weight_i:" << " " << c_weight_i[d] << " " // << "c_weight_f:" << " " << c_weight_f[d] << " " // << "c_weight_o:" << " " << c_weight_o[d] << endl; for(int i = 0; i < I_; ++i) { f_weight_i[d][i] = f_weight_i[d][i] - lr * f_i_gate_diff[t][d] * x[n * T_ + t][i]; f_weight_f[d][i] = f_weight_f[d][i] - lr * f_f_gate_diff[t][d] * x[n * T_ + t][i]; f_weight_g[d][i] = f_weight_g[d][i] - lr * f_g_gate_diff[t][d] * x[n * T_ + t][i]; f_weight_o[d][i] = f_weight_o[d][i] - lr * f_o_gate_diff[t][d] * x[n * T_ + t][i]; b_weight_i[d][i] = b_weight_i[d][i] - lr * b_i_gate_diff[t][d] * x[n * T_ + t][i]; b_weight_f[d][i] = b_weight_f[d][i] - lr * b_f_gate_diff[t][d] * x[n * T_ + t][i]; b_weight_g[d][i] = b_weight_g[d][i] - lr * b_g_gate_diff[t][d] * x[n * T_ + t][i]; b_weight_o[d][i] = b_weight_o[d][i] - lr * b_o_gate_diff[t][d] * x[n * T_ + t][i]; //cout << h_z_weight[k][d] << endl; } //update weights of hidden to hidden if(t < T_ - 1) { for(int h = 0; h<H_; ++h) { f_h_weight_i[d][h] = f_h_weight_i[d][h] - lr * f_h_i_gate_diff[t+1][h]; f_h_weight_f[d][h] = f_h_weight_f[d][h] - lr * f_h_f_gate_diff[t+1][h]; f_h_weight_g[d][h] = f_h_weight_g[d][h] - lr * f_h_g_gate_diff[t+1][h]; f_h_weight_o[d][h] = f_h_weight_o[d][h] - lr * f_h_o_gate_diff[t+1][h]; b_h_weight_i[d][h] = b_h_weight_i[d][h] - lr * b_h_i_gate_diff[t+1][h]; b_h_weight_f[d][h] = b_h_weight_f[d][h] - lr * b_h_f_gate_diff[t+1][h]; b_h_weight_g[d][h] = b_h_weight_g[d][h] - lr * b_h_g_gate_diff[t+1][h]; b_h_weight_o[d][h] = b_h_weight_o[d][h] - lr * b_h_o_gate_diff[t+1][h]; } } //hidden to output weights update error for(int k = 0; k<K_; ++k) { f_h_z_weight[k][d] = f_h_z_weight[k][d] - lr*gradient_O_h[t][k] * f_h_t[t][d]; b_h_z_weight[k][d] = f_h_z_weight[k][d] - lr*gradient_O_h[t][k] * b_h_t[t][d]; //cout << "h_z_weight:" << "" << h_z_weight[k][d] << endl; bias_z[k] = bias_z[k] - lr * gradient_O_h[t][k] ; } //bias of hidden to output f_bias_i[d] = f_bias_i[d] - lr * f_i_gate_diff[t][d]; f_bias_f[d] = f_bias_f[d] - lr * f_f_gate_diff[t][d]; f_bias_g[d] = f_bias_g[d] - lr * f_g_gate_diff[t][d]; f_bias_o[d] = f_bias_o[d] - lr * f_o_gate_diff[t][d]; b_bias_i[d] = b_bias_i[d] - lr * b_i_gate_diff[t][d]; b_bias_f[d] = b_bias_f[d] - lr * b_f_gate_diff[t][d]; b_bias_g[d] = b_bias_g[d] - lr * b_g_gate_diff[t][d]; b_bias_o[d] = b_bias_o[d] - lr * b_o_gate_diff[t][d]; //test predict accuary every batch } } } cout << "after update is ok" << endl; // 将每个sample的值清零(for test) for(int t_clear = 0; t_clear < T_; ++t_clear) { //cout << "clear"<< endl; for(int d = 0; d < H_; ++d) { f_c_t[t_clear][d] = 0; f_h_t[t_clear][d] = 0; f_net_i[t_clear][d] = 0; f_net_f[t_clear][d] = 0; f_net_g[t_clear][d] = 0; f_net_o[t_clear][d] = 0; f_gate_i[t_clear][d] = 0; f_gate_f[t_clear][d] = 0; f_state_g[t_clear][d] = 0; f_gate_o[t_clear][d] = 0; // 梯度可以 在batch时累加求均值 f_c_state_diff[t_clear][d] = 0; f_g_gate_diff[t_clear][d] = 0; f_f_gate_diff[t_clear][d] = 0; f_i_gate_diff[t_clear][d] = 0; f_o_gate_diff[t_clear][d] = 0; f_h_gate_diff[t_clear][d] = 0; //cell output diff f_h_i_gate_diff[t_clear][d] = 0; f_h_f_gate_diff[t_clear][d] = 0; f_h_g_gate_diff[t_clear][d] = 0; f_h_o_gate_diff[t_clear][d] = 0; f_error[t_clear][d] = 0; f_h_prev[d] = 0; f_c_prev[d] = 0; b_c_t[t_clear][d] = 0; b_h_t[t_clear][d] = 0; b_net_i[t_clear][d] = 0; b_net_f[t_clear][d] = 0; b_net_g[t_clear][d] = 0; b_net_o[t_clear][d] = 0; b_gate_i[t_clear][d] = 0; b_gate_f[t_clear][d] = 0; b_state_g[t_clear][d] = 0; b_gate_o[t_clear][d] = 0; // 梯度可以 在batch时累加求均值 b_c_state_diff[t_clear][d] = 0; b_g_gate_diff[t_clear][d] = 0; b_f_gate_diff[t_clear][d] = 0; b_i_gate_diff[t_clear][d] = 0; b_o_gate_diff[t_clear][d] = 0; b_h_gate_diff[t_clear][d] = 0; //cell output diff b_h_i_gate_diff[t_clear][d] = 0; b_h_f_gate_diff[t_clear][d] = 0; b_h_g_gate_diff[t_clear][d] = 0; b_h_o_gate_diff[t_clear][d] = 0; b_error[t_clear][d] = 0; b_h_prev[d] = 0; b_c_prev[d] = 0; } for(int k = 0; k < K_; ++k) { z_o[t_clear][k] = 0 ; gradient_O_h[t_clear][k] = 0; //o_h_diff[t_clear][k] = 0; softmax_o[t_clear][k] = 0; softmax_loss[t_clear][k] = 0; z_[k] = 0; // } } for(int test_iter = 0 ; test_iter < 1; ++test_iter) { cout << "test iter" << endl; double test_accuary = 0.0; // forwardpass of forward hidden layer for(int sample = 0; sample < N_; ++sample) { for(int t = 0; t < T_; ++t) // T_ step { //previous state for(int d = 0; d < H_; ++d) // H_:hidden units { // in, forget, g_sate, output // compute like MLP //cout << d << "hidden unit" << (n * T_ + t) << "x_input" << endl; for(int i = 0; i < I_; ++i) { f_net_i[t][d] += f_weight_i[d][i] * x[id[sample] * T_ + t][i]; f_net_f[t][d] += f_weight_f[d][i] * x[id[sample] * T_ + t][i]; f_net_g[t][d] += f_weight_g[d][i] * x[id[sample] * T_ + t][i]; f_net_o[t][d] += f_weight_o[d][i] * x[id[sample] * T_ + t][i]; //cout << id[n] << " id and label " << y[n] << endl; // test this block of code, x_input and bias are ok, weight_update is the problem } // !!! input is ok // sum the h(t-1) state; prev output的处理上应该存在问题 for(int j = 0; j < H_; ++j) { f_net_i[t][d] += f_h_weight_i[d][j] * f_h_prev[j]; f_net_f[t][d] += f_h_weight_f[d][j] * f_h_prev[j]; f_net_g[t][d] += f_h_weight_g[d][j] * f_h_prev[j]; f_net_o[t][d] += f_h_weight_o[d][j] * f_h_prev[j]; //std::cout << "h_prev" << h_prev[j] << "h_t" << h_t[t][j] << endl; } //sum c(t-1) f_net_i[t][d] += f_c_weight_i[d] * f_c_prev[d]; f_net_f[t][d] += f_c_weight_f[d] * f_c_prev[d]; //compute input gate, forget gate, candiate cell state, output gate f_gate_i[t][d] = sigmoid(f_net_i[t][d] + f_bias_i[d]);//input gate f_gate_f[t][d] = sigmoid(f_net_f[t][d] + f_bias_f[d]);//forget gate f_state_g[t][d] = tanh(f_net_g[t][d] + f_bias_g[d]); //cell output f_c_t[t][d] = f_gate_f[t][d] * f_c_prev[d] + f_gate_i[t][d] * f_state_g[t][d]; f_net_o[t][d] += f_c_weight_o[d] * f_c_t[t][d]; // output gate 多了一项c_t[t][d] // gate_o[t][d] = sigmoid(net_o[t][d] + c_t[t][d]); f_gate_o[t][d] = sigmoid(f_net_o[t][d] + f_bias_o[d]);//output gate //cell netoutput one time step f_h_t[t][d] = f_gate_o[t][d] * tanh(f_c_t[t][d]); //cell output //cout << "h_t out" << h_t[t][d] << endl; } //update prev h&c for(int d=0; d<H_; ++d) { f_h_prev[d] = f_h_t[t][d]; f_c_prev[d] = f_c_t[t][d]; } } //forward pass of backward hidden layer for(int t = T_-1; t >= 0; --t) // T_ step { //previous state for(int d = 0; d < H_; ++d) // H_:hidden units { // in, forget, g_sate, output // compute like MLP //cout << d << "hidden unit" << (n * T_ + t) << "x_input" << endl; for(int i = 0; i < I_; ++i) { b_net_i[t][d] += b_weight_i[d][i] * x[id[n] * T_ + t][i] ; b_net_f[t][d] += b_weight_f[d][i] * x[id[n] * T_ + t][i] ; b_net_g[t][d] += b_weight_g[d][i] * x[id[n] * T_ + t][i] ; b_net_o[t][d] += b_weight_o[d][i] * x[id[n] * T_ + t][i] ; //cout << id[n] << " id and label " << y[n] << endl; // test this block of code, x_input and bias are ok, weight_update is the problem } // !!! input is ok // sum the h(t-1) state; prev output的处理上应该存在问题 for(int j = 0; j < H_; ++j) { b_net_i[t][d] += b_h_weight_i[d][j] * b_h_prev[j]; b_net_f[t][d] += b_h_weight_f[d][j] * b_h_prev[j]; b_net_g[t][d] += b_h_weight_g[d][j] * b_h_prev[j]; b_net_o[t][d] += b_h_weight_o[d][j] * b_h_prev[j]; //std::cout << "h_prev" << h_prev[j] << "h_t" << h_t[t][j] << endl; } //sum c(t-1) b_net_i[t][d] += b_c_weight_i[d] * b_c_prev[d]; b_net_f[t][d] += b_c_weight_f[d] * b_c_prev[d]; //compute input gate, forget gate, candiate cell state, output gate b_gate_i[t][d] = sigmoid(b_net_i[t][d] + b_bias_i[d]);//input gate b_gate_f[t][d] = sigmoid(b_net_f[t][d] + b_bias_f[d]);//forget gate b_state_g[t][d] = tanh(b_net_g[t][d] + b_bias_g[d]); //cell output b_c_t[t][d] = b_gate_f[t][d] * b_c_prev[d] + b_gate_i[t][d] * b_state_g[t][d]; b_net_o[t][d] += b_c_weight_o[d] * b_c_t[t][d]; // output gate 多了一项c_t[t][d] // gate_o[t][d] = sigmoid(net_o[t][d] + c_t[t][d]); b_gate_o[t][d] = sigmoid(b_net_o[t][d] + b_bias_o[d]);//output gate //cell netoutput one time step b_h_t[t][d] = b_gate_o[t][d] * tanh(b_c_t[t][d]); //cell output //cout << "h_t out" << h_t[t][d] << endl; } //update prev h&c for(int d=0; d<H_; ++d) { b_h_prev[d] = b_h_t[t][d]; b_c_prev[d] = b_c_t[t][d]; } } // forward is ok 未出现 core dumped // compute // output layer for(int t=0; t<T_; ++t) { //std::cout << t <<"step" << std::endl; for(int f = 0; f < K_; ++f) { for(int h = 0; h < H_; ++h) { z_o[t][f] += f_h_z_weight[f][h] * f_h_t[t][h] + b_h_z_weight[f][h] * b_h_t[t][h]; } z_o[t][f] = z_o[t][f] + bias_z[f]; z_[f] = z_o[t][f]; //cout << f << " bias_z:" << bias_z[f] << "z_o" << z_[f] << std::endl; //at time step computesoftmax } softmax(z_); for(int f = 0; f < K_; ++f) { softmax_o[t][f] = *ip; sum += softmax_o[t][f]; //std::cout << "the probability of" << f << "output units:" << " " // << "lable" <<id[n]/8 << " " // << softmax_o[t][f] << std::endl; ip++; softmax_loss[t][f] = -log(softmax_o[t][f]); } //std::cout << "sum" << std::endl; //std::cout << sum << std::endl; sum = 0; for(int k = 0; k < K_; ++k) { loss += softmax_loss[t][k]; } ip = z_; //num++; double p_out_max = 0; double p_out[T_][K_]; int y_predict = 0; for(int i = 0; i<K_; ++i) { for(int t = 0; t<T_; ++t) p_out[t][i] = 0; } for(int frame = 0; frame < T_; ++frame) { // compute every output units "T" step probility for(int out = 0; out < K_; ++out) { p_out[frame][out] = softmax_o[frame][out]; //cout << "p_out" << p_out[frame][out] << endl; if(p_out[frame][out] > p_out_max ) { p_out_max = p_out[frame][out]; y_predict = out; //cout << y_predict << endl; } } //compute the if(y_predict == y_test[sample]) { test_accuary += 1 / double(300 * N_ ); //cout << "accuary change :" << test_accuary << endl; } } } cout << "test_accuary :" << test_accuary << endl; } //clear end } for(int t_clear = 0; t_clear < T_; ++t_clear) { //cout << "clear"<< endl; for(int d = 0; d < H_; ++d) { f_c_t[t_clear][d] = 0; f_h_t[t_clear][d] = 0; f_net_i[t_clear][d] = 0; f_net_f[t_clear][d] = 0; f_net_g[t_clear][d] = 0; f_net_o[t_clear][d] = 0; f_gate_i[t_clear][d] = 0; f_gate_f[t_clear][d] = 0; f_state_g[t_clear][d] = 0; f_gate_o[t_clear][d] = 0; // 梯度可以 在batch时累加 f_c_state_diff[t_clear][d] = 0; f_g_gate_diff[t_clear][d] = 0; f_f_gate_diff[t_clear][d] = 0; f_i_gate_diff[t_clear][d] = 0; f_o_gate_diff[t_clear][d] = 0; f_h_gate_diff[t_clear][d] = 0; //cell output diff f_h_i_gate_diff[t_clear][d] = 0; f_h_f_gate_diff[t_clear][d] = 0; f_h_g_gate_diff[t_clear][d] = 0; f_h_o_gate_diff[t_clear][d] = 0; f_error[t_clear][d] = 0; f_h_prev[d] = 0; f_c_prev[d] = 0; b_c_t[t_clear][d] = 0; b_h_t[t_clear][d] = 0; b_net_i[t_clear][d] = 0; b_net_f[t_clear][d] = 0; b_net_g[t_clear][d] = 0; b_net_o[t_clear][d] = 0; b_gate_i[t_clear][d] = 0; b_gate_f[t_clear][d] = 0; b_state_g[t_clear][d] = 0; b_gate_o[t_clear][d] = 0; // 梯度可以 在batch时累加 b_c_state_diff[t_clear][d] = 0; b_g_gate_diff[t_clear][d] = 0; b_f_gate_diff[t_clear][d] = 0; b_i_gate_diff[t_clear][d] = 0; b_o_gate_diff[t_clear][d] = 0; b_h_gate_diff[t_clear][d] = 0; //cell output diff b_h_i_gate_diff[t_clear][d] = 0; b_h_f_gate_diff[t_clear][d] = 0; b_h_g_gate_diff[t_clear][d] = 0; b_h_o_gate_diff[t_clear][d] = 0; b_error[t_clear][d] = 0; b_h_prev[d] = 0; b_c_prev[d] = 0; } for(int k = 0; k < K_; ++k) { z_o[t_clear][k] = 0 ; gradient_O_h[t_clear][k] = 0; softmax_o[t_clear][k] = 0; softmax_loss[t_clear][k] = 0; z_[k] = 0; // } } } } return 0; }
[ "xgsbsz@gmail.com" ]
xgsbsz@gmail.com
604600cbb4d827d84b8fe52dee40d690ff06a3c1
f4db57cf0daedda942b1c471c33c85ecfc07dc84
/benchmark/bmalloc/bmalloc/Logging.cpp
e1fb60cb816d450d2ed3c91e982bec02db0320b4
[ "Unlicense", "LicenseRef-scancode-public-domain" ]
permissive
ivan-tkatchev/rpmalloc-benchmark
18a9d387554e75e0eb06c5fcb20e1d23544bd37d
01daff466ec7971a618a52a04f09740feefc591e
refs/heads/master
2020-04-05T13:55:51.697011
2018-11-30T14:43:48
2018-11-30T14:43:48
156,916,175
0
0
Unlicense
2018-11-09T20:46:00
2018-11-09T20:45:59
null
UTF-8
C++
false
false
2,314
cpp
/* * Copyright (C) 2016 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "Logging.h" #include "BPlatform.h" #if !BUSE(OS_LOG) #include <stdarg.h> #include <stdio.h> #endif #if BPLATFORM(IOS) #include <mach/exception_types.h> #include <objc/objc.h> #include <unistd.h> #include "BSoftLinking.h" BSOFT_LINK_PRIVATE_FRAMEWORK(CrashReporterSupport); BSOFT_LINK_FUNCTION(CrashReporterSupport, SimulateCrash, BOOL, (pid_t pid, mach_exception_data_type_t exceptionCode, id description), (pid, exceptionCode, description)); #endif namespace bmalloc { void logVMFailure() { #if BPLATFORM(IOS) const mach_exception_data_type_t kExceptionCode = 0xc105ca11; SimulateCrash(getpid(), kExceptionCode, nullptr); #endif } #if !BUSE(OS_LOG) void reportAssertionFailureWithMessage(const char* file, int line, const char* function, const char* format, ...) { va_list args; va_start(args, format); vfprintf(stderr, format, args); va_end(args); fprintf(stderr, "%s(%d) : %s\n", file, line, function); } #endif } // namespace bmalloc
[ "mattias@rampantpixels.com" ]
mattias@rampantpixels.com
f931b21f714e65f670168f07cf85ef3a46a23aee
d269301d6dd4038b3f7de6c4ffd1fe75d1af95c8
/common/hal/inc/custom/debug_exif/cam/dbg_cam_n3d_param1.h
708c4ea9e915b784debd4ca34b0cc5ea537f66b7
[]
no_license
Skyrimus/camera_hals_5015D_5010D
435d712e972db6c5940051625058069541cbd1ce
2ab5f5826ced1a10e298886ff2ee3e1221610c2a
refs/heads/master
2020-03-27T10:56:08.783761
2018-08-28T14:10:54
2018-08-28T14:10:56
146,454,642
2
1
null
2018-09-09T19:41:12
2018-08-28T13:50:15
C
UTF-8
C++
false
false
10,836
h
/* Copyright Statement: * * This software/firmware and related documentation ("MediaTek Software") are * protected under relevant copyright laws. The information contained herein * is confidential and proprietary to MediaTek Inc. and/or its licensors. * Without the prior written permission of MediaTek inc. and/or its licensors, * any reproduction, modification, use or disclosure of MediaTek Software, * and information contained herein, in whole or in part, shall be strictly prohibited. */ /* MediaTek Inc. (C) 2010. All rights reserved. * * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND * CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. * * The following software/firmware and/or related documentation ("MediaTek Software") * have been modified by MediaTek Inc. All revisions are subject to any receiver's * applicable license agreements with MediaTek Inc. */ #pragma once /****************************************************************************** * ******************************************************************************/ #include "../dbg_exif_def.h" namespace dbg_cam_n3d_param_1 { /****************************************************************************** * ******************************************************************************/ enum { N3D_AE_TAG_DEBUG_VERSION = 0, N3D_AE_SYNCNUM, N3D_AE_SYNCMODE, N3D_AE_SYNCPOLICY, N3D_AE_LOWER_BV, N3D_AE_UPPER_BV, N3D_AE_MASTER_IDX, N3D_AE_CAL_GAIN_R, N3D_AE_CAL_GAIN_G, N3D_AE_CAL_GAIN_B, N3D_AE_CAL_YGAIN, N3D_AE_CAL_OFFSET, N3D_AE_REG_OFFSET, N3D_AE_0_AEIDX, N3D_AE_0_AFEGAIN, N3D_AE_0_SHUTTER, N3D_AE_0_ISPGAIN, N3D_AE_0_CWY, N3D_AE_0_SYNCGAIN, N3D_AE_1_AEIDX, N3D_AE_1_AFEGAIN, N3D_AE_1_SHUTTER, N3D_AE_1_ISPGAIN, N3D_AE_1_CWY, N3D_AE_1_SYNCGAIN, N3D_AE_TAG_MAX }; //N3D AE debug info enum { N3D_AE_DEBUG_VERSION = 2 }; enum { N3D_AE_DEBUG_TAG_SIZE = (N3D_AE_TAG_MAX+10) }; typedef struct { debug_exif_field Tag[N3D_AE_DEBUG_TAG_SIZE]; } N3D_AE_DEBUG_INFO_T; /****************************************************************************** * ******************************************************************************/ enum { //Intermedium Data N3D_AWB_TAG_DEBUG_VERSION = N3D_AE_TAG_MAX, N3D_AWB_AWBSYNC_METHOD, N3D_AWB_GAIN_INT_SLOPE, N3D_AWB_GAIN_INT_NORM, N3D_AWB_GAIN_INT_OFFSET, N3D_AWB_GAIN_INT_FREERUN_RATIO_RG, N3D_AWB_GAIN_INT_FREERUN_RATIO_BG, N3D_AWB_ADV_PP_TUNING_VALID_BLK_NUM_RATIO, N3D_AWB_ADV_PP_TUNING_AWBSTA_Y_TH, N3D_AWB_ADV_PP_MAIN_VALID_BLK_COUNT, N3D_AWB_ADV_PP_SUB_VALID_BLK_COUNT, N3D_AWB_ADV_PP_MAIN_STAT_AVG_R, N3D_AWB_ADV_PP_MAIN_STAT_AVG_G, N3D_AWB_ADV_PP_MAIN_STAT_AVG_B, N3D_AWB_ADV_PP_SUB_STAT_AVG_R, N3D_AWB_ADV_PP_SUB_STAT_AVG_G, N3D_AWB_ADV_PP_SUB_STAT_AVG_B, N3D_AWB_SYNC_CCT_ISFREERUN, N3D_AWB_SYNC_CCT_GAIN_R, N3D_AWB_SYNC_CCT_GAIN_G, N3D_AWB_SYNC_CCT_GAIN_B, N3D_AWB_SYNC_GAIN_INT_ISFREERUN, N3D_AWB_SYNC_GAIN_INT_GAIN_R, N3D_AWB_SYNC_GAIN_INT_GAIN_G, N3D_AWB_SYNC_GAIN_INT_GAIN_B, N3D_AWB_SYNC_ADV_PP_ISFREERUN, N3D_AWB_SYNC_ADV_PP_GAIN_R, N3D_AWB_SYNC_ADV_PP_GAIN_G, N3D_AWB_SYNC_ADV_PP_GAIN_B, N3D_AWB_SYNC_BLENDING_ISFREERUN, N3D_AWB_SYNC_BLENDING_GAIN_R, N3D_AWB_SYNC_BLENDING_GAIN_G, N3D_AWB_SYNC_BLENDING_GAIN_B, N3D_AWB_SYNC_FINAL_ISFREERUN, N3D_AWB_SYNC_FINAL_GAIN_R, N3D_AWB_SYNC_FINAL_GAIN_G, N3D_AWB_SYNC_FINAL_GAIN_B, //Input Data - Main N3D_AWB_MAIN_NORMAL_WB_HORIZON_GAIN_R, N3D_AWB_MAIN_NORMAL_WB_HORIZON_GAIN_G, N3D_AWB_MAIN_NORMAL_WB_HORIZON_GAIN_B, N3D_AWB_MAIN_HORIZON_CCT, N3D_AWB_MAIN_NORMAL_WB_A_GAIN_R, N3D_AWB_MAIN_NORMAL_WB_A_GAIN_G, N3D_AWB_MAIN_NORMAL_WB_A_GAIN_B, N3D_AWB_MAIN_A_CCT, N3D_AWB_MAIN_NORMAL_WB_TL84_GAIN_R, N3D_AWB_MAIN_NORMAL_WB_TL84_GAIN_G, N3D_AWB_MAIN_NORMAL_WB_TL84_GAIN_B, N3D_AWB_MAIN_NORMAL_WB_CWF_GAIN_R, N3D_AWB_MAIN_NORMAL_WB_CWF_GAIN_G, N3D_AWB_MAIN_NORMAL_WB_CWF_GAIN_B, N3D_AWB_MAIN_TL84_CCT, N3D_AWB_MAIN_NORMAL_WB_DNP_GAIN_R, N3D_AWB_MAIN_NORMAL_WB_DNP_GAIN_G, N3D_AWB_MAIN_NORMAL_WB_DNP_GAIN_B, N3D_AWB_MAIN_DNP_CCT, N3D_AWB_MAIN_NORMAL_WB_D65_GAIN_R, N3D_AWB_MAIN_NORMAL_WB_D65_GAIN_G, N3D_AWB_MAIN_NORMAL_WB_D65_GAIN_B, N3D_AWB_MAIN_D65_CCT, N3D_AWB_MAIN_UNIT_GAIN_R, N3D_AWB_MAIN_UNIT_GAIN_G, N3D_AWB_MAIN_UNIT_GAIN_B, N3D_AWB_MAIN_GOLDEN_GAIN_R, N3D_AWB_MAIN_GOLDEN_GAIN_G, N3D_AWB_MAIN_GOLDEN_GAIN_B, N3D_AWB_MAIN_CURR_GAIN_R, N3D_AWB_MAIN_CURR_GAIN_G, N3D_AWB_MAIN_CURR_GAIN_B, N3D_AWB_MAIN_CURR_ALG_GAIN_R, N3D_AWB_MAIN_CURR_ALG_GAIN_G, N3D_AWB_MAIN_CURR_ALG_GAIN_B, N3D_AWB_MAIN_CURR_TARGET_GAIN_R, N3D_AWB_MAIN_CURR_TARGET_GAIN_G, N3D_AWB_MAIN_CURR_TARGET_GAIN_B, N3D_AWB_MAIN_CURR_CCT, N3D_AWB_MAIN_CURR_LIGHT_MODE, N3D_AWB_MAIN_CURR_LV, N3D_AWB_MAIN_CURR_TUNGSTEN_P, N3D_AWB_MAIN_CURR_WARM_FLUORESCENT_P, N3D_AWB_MAIN_CURR_FLUORESCENT_P, N3D_AWB_MAIN_CURR_CWF_P, N3D_AWB_MAIN_CURR_DAYLIGHT_P, N3D_AWB_MAIN_CURR_SHADE_P, N3D_AWB_MAIN_CURR_DAYLIGHT_FLUORESCENT_P, //Input Data - Sub N3D_AWB_SUB_NORMAL_WB_HORIZON_GAIN_R, N3D_AWB_SUB_NORMAL_WB_HORIZON_GAIN_G, N3D_AWB_SUB_NORMAL_WB_HORIZON_GAIN_B, N3D_AWB_SUB_HORIZON_CCT, N3D_AWB_SUB_NORMAL_WB_A_GAIN_R, N3D_AWB_SUB_NORMAL_WB_A_GAIN_G, N3D_AWB_SUB_NORMAL_WB_A_GAIN_B, N3D_AWB_SUB_A_CCT, N3D_AWB_SUB_NORMAL_WB_TL84_GAIN_R, N3D_AWB_SUB_NORMAL_WB_TL84_GAIN_G, N3D_AWB_SUB_NORMAL_WB_TL84_GAIN_B, N3D_AWB_SUB_NORMAL_WB_CWF_GAIN_R, N3D_AWB_SUB_NORMAL_WB_CWF_GAIN_G, N3D_AWB_SUB_NORMAL_WB_CWF_GAIN_B, N3D_AWB_SUB_TL84_CCT, N3D_AWB_SUB_NORMAL_WB_DNP_GAIN_R, N3D_AWB_SUB_NORMAL_WB_DNP_GAIN_G, N3D_AWB_SUB_NORMAL_WB_DNP_GAIN_B, N3D_AWB_SUB_DNP_CCT, N3D_AWB_SUB_NORMAL_WB_D65_GAIN_R, N3D_AWB_SUB_NORMAL_WB_D65_GAIN_G, N3D_AWB_SUB_NORMAL_WB_D65_GAIN_B, N3D_AWB_SUB_D65_CCT, N3D_AWB_SUB_UNIT_GAIN_R, N3D_AWB_SUB_UNIT_GAIN_G, N3D_AWB_SUB_UNIT_GAIN_B, N3D_AWB_SUB_GOLDEN_GAIN_R, N3D_AWB_SUB_GOLDEN_GAIN_G, N3D_AWB_SUB_GOLDEN_GAIN_B, N3D_AWB_SUB_CURR_GAIN_R, N3D_AWB_SUB_CURR_GAIN_G, N3D_AWB_SUB_CURR_GAIN_B, N3D_AWB_SUB_CURR_ALG_GAIN_R, N3D_AWB_SUB_CURR_ALG_GAIN_G, N3D_AWB_SUB_CURR_ALG_GAIN_B, N3D_AWB_SUB_CURR_TARGET_GAIN_R, N3D_AWB_SUB_CURR_TARGET_GAIN_G, N3D_AWB_SUB_CURR_TARGET_GAIN_B, N3D_AWB_SUB_CURR_CCT, N3D_AWB_SUB_CURR_LIGHT_MODE, N3D_AWB_SUB_CURR_LV, N3D_AWB_SUB_CURR_TUNGSTEN_P, N3D_AWB_SUB_CURR_WARM_FLUORESCENT_P, N3D_AWB_SUB_CURR_FLUORESCENT_P, N3D_AWB_SUB_CURR_CWF_P, N3D_AWB_SUB_CURR_DAYLIGHT_P, N3D_AWB_SUB_CURR_SHADE_P, N3D_AWB_SUB_CURR_DAYLIGHT_FLUORESCENT_P, N3D_AWB_GAIN_INT_GAINRATIO_TH0, N3D_AWB_GAIN_INT_GAINRATIO_TH1, N3D_AWB_GAIN_INT_GAINRATIO_TH2, N3D_AWB_GAIN_INT_GAINRATIO_TH3, N3D_AWB_GAIN_INT_CCT_DIFF_TH0, N3D_AWB_GAIN_INT_CCT_DIFF_TH1, N3D_AWB_GAIN_INT_CCT_DIFF_TH2, N3D_AWB_GAIN_INT_CCT_DIFF_TH3, N3D_AWB_GAIN_BLENDING_TH0, N3D_AWB_GAIN_BLENDING_TH1, N3D_AWB_GAIN_BLENDING_TH2, N3D_AWB_GAIN_BLENDING_TH3, N3D_AWB_GAIN_INT_MASTER_GAIN_H_R, N3D_AWB_GAIN_INT_MASTER_GAIN_H_B, N3D_AWB_GAIN_INT_MASTER_GAIN_A_R, N3D_AWB_GAIN_INT_MASTER_GAIN_A_B, N3D_AWB_GAIN_INT_MASTER_GAIN_TL84_R, N3D_AWB_GAIN_INT_MASTER_GAIN_TL84_B, N3D_AWB_GAIN_INT_MASTER_GAIN_DNP_R, N3D_AWB_GAIN_INT_MASTER_GAIN_DNP_B, N3D_AWB_GAIN_INT_MASTER_GAIN_D65_R, N3D_AWB_GAIN_INT_MASTER_GAIN_D65_B, N3D_AWB_GAIN_INT_SLAVE_GAIN_H_R, N3D_AWB_GAIN_INT_SLAVE_GAIN_H_B, N3D_AWB_GAIN_INT_SLAVE_GAIN_A_R, N3D_AWB_GAIN_INT_SLAVE_GAIN_A_B, N3D_AWB_GAIN_INT_SLAVE_GAIN_TL84_R, N3D_AWB_GAIN_INT_SLAVE_GAIN_TL84_B, N3D_AWB_GAIN_INT_SLAVE_GAIN_DNP_R, N3D_AWB_GAIN_INT_SLAVE_GAIN_DNP_B, N3D_AWB_GAIN_INT_SLAVE_GAIN_D65_R, N3D_AWB_GAIN_INT_SLAVE_GAIN_D65_B, //Output Data - Main N3D_AWB_MAIN_OUTPUT_GAIN_R, N3D_AWB_MAIN_OUTPUT_GAIN_G, N3D_AWB_MAIN_OUTPUT_GAIN_B, N3D_AWB_MAIN_OUTPUT_CCT, //Output Data - Sub N3D_AWB_SUB_OUTPUT_GAIN_R, N3D_AWB_SUB_OUTPUT_GAIN_G, N3D_AWB_SUB_OUTPUT_GAIN_B, N3D_AWB_SUB_OUTPUT_CCT, N3D_AWB_TAG_MAX }; //N3D AWB debug info enum { N3D_AWB_DEBUG_VERSION = 2 }; enum { N3D_AWB_DEBUG_TAG_SIZE = (N3D_AWB_TAG_MAX+10) }; typedef struct { debug_exif_field Tag[N3D_AWB_DEBUG_TAG_SIZE]; } N3D_AWB_DEBUG_INFO_T; /****************************************************************************** * ******************************************************************************/ //Common Parameter Structure typedef enum { N3D_TAG_VERSION = 0, }DEBUG_N3D_TAG_T; // Native3D debug info enum { N3D_DEBUG_TAG_SIZE = (N3D_AE_DEBUG_TAG_SIZE+N3D_AWB_DEBUG_TAG_SIZE) }; enum { N3D_DEBUG_TAG_VERSION = 1 }; enum { DEBUG_N3D_AE_MODULE_ID = 0x0001 }; enum { DEBUG_N3D_AWB_MODULE_ID = 0x0002 }; typedef struct DEBUG_N3D_INFO_S { debug_exif_field Tag[N3D_DEBUG_TAG_SIZE]; } DEBUG_N3D_INFO_T; typedef struct { N3D_AE_DEBUG_INFO_T rAEDebugInfo; N3D_AWB_DEBUG_INFO_T rAWBDebugInfo; } N3D_DEBUG_INFO_T; /****************************************************************************** * ******************************************************************************/ }; //namespace
[ "skyrimus@yandex.ru" ]
skyrimus@yandex.ru
8fa5aee09ae4b9891603f32c731fc14c2b7ecfb9
06144da75812715881f1c9c635689ea920f422e3
/Source/DataHolders/LevelDataAsset.cpp
5533b750c8109e87946db2b0ade131673b647cdd
[ "MIT" ]
permissive
kseon12/SlavhorodskyiVlad_UE4TraineeTest
247349cfa3a82224aa9e2e04af0deea9d8918730
7c4f69a57c50b4c40371bd658f5d73849ade3a96
refs/heads/main
2023-05-08T12:28:56.806521
2021-05-31T22:55:03
2021-05-31T22:55:03
370,443,459
0
0
null
null
null
null
UTF-8
C++
false
false
475
cpp
// Fill out your copyright notice in the Description page of Project Settings. #include "LevelDataAsset.h" #include "Tools/MacroTools.h" FString ULevelDataAsset::GetLevelName(EAvailableLevels Level) const { if (!EnsureMsg(GameLevels.Contains(Level), TEXT("[LevelData] There is no such level in database. Check it carefully, maybe it is ok for design if there is no such level in the GameState"))) { return {}; } return GameLevels.Find(Level)->GetAssetName(); }
[ "eugene.fomin@playwing.net" ]
eugene.fomin@playwing.net
f71da7a230fbd686e6358d458b199cf66dc8ef60
d71402cd7a95aa34e30448194e5f9ff5f6b8e37f
/performance_tests/src/nodes/publisher_node.cpp
e20c1b84bb6c1c113ea407ed19d31fbff6842f2b
[]
no_license
beatrizfusaro/blueo-exercises
c1d5ec6429a6fd1d359d36065c78ca9d7479c3ae
67751183c963598bc5a739e09c059da82c2a8386
refs/heads/master
2020-07-28T21:18:37.147318
2019-09-19T15:30:04
2019-09-19T15:30:04
209,540,666
0
0
null
null
null
null
UTF-8
C++
false
false
215
cpp
#include <performance_tests/publisher.h> int main(int argc, char **argv) { ros::init(argc, argv, "publisher"); ros::NodeHandle nh; performance_tests::PublisherTest node(nh); ros::spin(); return 0; }
[ "beatrizfusaro@gatech.edu" ]
beatrizfusaro@gatech.edu
d6d573b8ef6321829ec27b56406f8035fee49c21
143ee2c7b0f36bc0719b2ef08c9f04ff6a5f83ff
/popobird-cocos2dx-v2/Classes/CherryNode.cpp
cb914bec37e2642cd6dc5430e32042d2a38f8eef
[]
no_license
xiangtone/xtone-public-base
f2538b5755629203dc44e6b821e3eab2614ef03e
389098340d614610dd6c9a6a90f291129b14a551
refs/heads/master
2020-04-04T04:10:33.214528
2018-05-08T05:09:08
2018-05-08T05:09:08
46,548,224
1
1
null
null
null
null
UTF-8
C++
false
false
1,116
cpp
#include "CherryNode.h" #define CHERRY_FILE_NAME ("cherry.png") CherryNode::CherryNode() { } CherryNode::~CherryNode() { } bool CherryNode::init() { if (!CCNode::init()) return false; CCNode *cherry = createTexture(CHERRY_FILE_NAME); this->addChild(cherry); this->setObjectType(kCherryType); return true; } CherryNode* CherryNode::create() { CherryNode *pRet = new CherryNode(); if (pRet && pRet->init()) { pRet->autorelease(); return pRet; } else { CC_SAFE_DELETE(pRet); return NULL; } } bool CherryNode::collisionWithOther( CCNode *other ) { if (other != NULL) { this->removeFromParent(); } return true; } void CherryNode::updateWithDeltaTime( float dt, CCArray *listObjects ) { } cocos2d::CCRect CherryNode::adjustedBoundingBox() { CCRect r; r = this->boundingBox(); float xOffset = r.size.width * 0.1f; float yOffset = r.size.height * 0.1f; float xCropAmount = r.size.width * 0.2f; float yCropAmount = r.size.height * 0.2f; r = CCRectMake(r.origin.x + xOffset, r.origin.y + yOffset, r.size.width - xCropAmount, r.size.height - yCropAmount); return r; }
[ "13565644@qq.com" ]
13565644@qq.com
8e100f8d301cd085b5e83a6d816cfca3188f8f6d
313df7ef5601ead89827a9d23443ef5ab80c55d6
/NEUROPATHY_HEAT_DIAGNOSTIC.ino
0ed74418ba88b5ddc15b1fec9d566bb3672efeca
[]
no_license
jmayeda/MAE156b-Neuropathy-Diagnostic-Device
24fba7fd03466ba441b3d862487fc984049dd107
2e9fbc349c9a7dbb488167f3dcfaef8acae5c282
refs/heads/master
2020-03-11T17:50:39.173851
2018-06-13T00:32:18
2018-06-13T00:32:18
130,159,025
0
0
null
null
null
null
UTF-8
C++
false
false
14,784
ino
/*NEUROPATHY_HEAT_DIAGNOSTIC.ino * * @authors: Naif Alzahri, Thomas Ibbetson, Jason Mayeda, Inri Rodriguez * @date: Feb-June 2018 * @about: Program to control a heat diagnostic test for WinSanTor neuropathy trials. **/ #include <math.h> #include <LiquidCrystal.h> // ================================== INPUTS 11 ================================ // #define inputPin_TS_Ambient_1 A1 #define inputPin_TS_Ambient_2 A2 #define inputPin_TS_Ambient_3 A3 #define inputPin_TS_Ambient_4 A4 #define inputPin_TS_Focal A0 #define inputPin_StartButton 2 //interrupt enabled #define inputPin_MS_Echo 5 #define inputPin_MS_Reflect 6 #define GREEN_LED_PIN 7 #define RED_LED_PIN 8 // ===================== OUTPUTS 2 #define outputPin_MS_Trigger 4 #define outputPin_Heat_Ambient 13 #define outputPin_Heat_Focal 12 // ===================== Config for Sampling and Controllers ====================== // #define BETA 3380 // *linear*ish coefficient of thermistor resistance to temperature // Ambient Controller #define KP_AMBIENT 25 // 0.035 proportional gain for error #define KI_AMBIENT 0.1 //integral gain for error #define AMBIENT_INT_MAX 100 // TODO: prevent integrator wind-up #define ROOM_TEMP_K 298.15 // room temp in Kelvin #define REF_TEMP_AMBIENT 30.0 // ambient temperature setpoint // Focal Heating Controller #define KP_FOCAL 15 // TODO: tune PID gains #define KI_FOCAL 0.5 #define KD_FOCAL 0.7 #define FOCAL_INT_MAX 100 // TODO: prevent integrator wind-up #define REF_TEMP_CHANGE_FOCAL 1.0 // we want a 1 degree/s change for focal heating #define TEMP_CUTOFF 50.0 // we don't want to increase beyond 50 deg C // FROM ULTRASONIC SENSOR CODE #define SETUP_TIME_S 5 // amount of time to calibrate the ultrasonic sensor #define DIST_THRESHOLD 1.1 // trigger the end of the test // Safety #define SAFETY_TEMP 49 // maximum temperature of system (celsius) // Ready up --> indicates that ambient temp is between min and max and therefore is ready to test #define Min_Test_Temp 28.0 #define Max_Test_Temp 32.0 // ============================== TYPE DEFINITION ========================== // typedef struct state_t { // important system state parameters long time_Milli; // time at which state was measured float temp_Focal; // glass temperature at the focal source float rate_Focal ; // degrees per second heating rate of focal point float temp_Ambient; // ambient temperature in the chamber float dist_Ultra; // distance measured by ultrasonic sensor int duty_Ambient; // duty that will be applied to ambient heaters int duty_Focal; // duty that will be applied to focal heater int motion_Detected; // output of the motion sensor(detected: 1, nothing: 0) int running; // running state - 1 or 0, } state_t; // ==================================== Function Declaration ==================================== // float Calibrate_Ultra(int TrigPin, int EchoPin, int setupTimeS); int Controller_Ambient(float Ref_Temp_Ambient); int Controller_Focal(float Ref_Temp_Change_Focal); state_t MEASURE(); int read_MotionSensors(); int read_MS_Reflect(int pin); float read_MS_Ultra(int TrigPin,int EchoPin); float read_Thermistor(int pin); void reset_ISR(); void safety(); void shutdown(); void write_LCD_message(char message); void write_LCD_temp(float temp); // ==================================== GLOBAL VARIABLE ==================================== // state_t state_Now = {0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0}; //current state state_t state_Last = {0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0}; // previous state state_t state_Start = {0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0}; // state at beginning of test state_t state_End = {0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0}; // state at end of test //volatile int buttonState = 0; // Flag for reseting the test int testType = 0; // Flag for type of test (contact: 0 (default), non-contact: 1) int test_complete = FALSE; // signal // ================================ SETUP =================================== // void setup() { // Initialize serial monitor Serial.begin(9600); // setup pins pinMode(inputPin_TS_Focal, INPUT); pinMode(inputPin_TS_Ambient_1, INPUT); pinMode(inputPin_TS_Ambient_2, INPUT); pinMode(inputPin_TS_Ambient_3, INPUT); pinMode(inputPin_TS_Ambient_4, INPUT); pinMode(inputPin_StartButton, INPUT) ; pinMode(inputPin_MS_Reflect, INPUT); pinMode(inputPin_MS_Trigger, OUTPUT); pinMode(inputPin_MS_Echo, INPUT); pinMode(outputPin_Heat_Focal, OUTPUT); pinMode(outputPin_Heat_Ambient, OUTPUT); // interrupt pin for the reset button attachInterrupt(digitalPinToInterrupt(BUTTON_PIN), reset_ISR, CHANGE); //Chillax bruh delay(1000); } // ============================== MAIN LOOP ================================= // void loop() { state_Last = state_Now; state_Now = MEASURE(); //update current state with temperatures, time, // Ambient Heating controller int unsafe = TRUE; // assume conditions are bad while (unsafe){ // loop until temperatures are safe if ((state_Now.temp_Focal > SAFETY_TEMP) || (state_Now.temp_Ambient > SAFETY_TEMP)) { // we're getting too hot up in here analogWrite(outputPin_Heat_Ambient, 0); //turn off ambient shutdown(); // turn off everything write_LCD_message('Overheat'); state_Now.running = FALSE; // test running flag set to FALSE delay(5000); // 5 seconds to cool down before checking again } else { unsafe = FALSE; // conditions are not actually bad, continue analogWrite(outputPin_Heat_Ambient, state.duty_Focal); } } if (state_Now.running == FALSE){ // If test is not running but temps are safe shutdown(); if (state_Now.temp_Ambient > Min_Test_Temp && state_Now.temp_Ambient < Max_Test_Temp){ write_LCD_message('Ready for test') } else{ write_LCD_message('Resetting...'); } } else { // write to focal heater state_Now.duty_Focal = Controller_Focal(REF_TEMP_CHANGE_FOCAL); analogWrite(outputPin_Heat_Focal, state_Now.duty_Focal); } if (state_Now.motion_Detected) { state_Now.running = FALSE; test_complete = TRUE; state_End = state_Now; while (test_complete) { write_LCD_temp(state_End.temp_Focal); } } write_LCD_temp(state_Now.temp_Focal); } // =========================== DEFINED FUNCTIONS ============================ // /* * int Controller_Ambient() * * Implement controller algorithim for the ambient heater to maintain * the housing temperature at ref_Temp_Ambient. */ int Controller_Ambient(float Ref_Temp_Ambient){ // static variables initialize once, the first time the function is called static float cumalitiveError = 0; static float I_term = 0; float P_term = 0; // update current error float currError = Ref_Temp_Ambient - state_Now.temp_Ambient; // sum up cumalitive error cumalitiveError += currError; // prevent integrator wind-up if (cumalitiveError > AMBIENT_INT_MAX) { cumalitiveError = AMBIENT_INT_MAX; } else if (cumalitiveError < -AMBIENT_INT_MAX) { cumalitiveError = -AMBIENT_INT_MAX; } // PI control I_term = KI_AMBIENT * cumalitiveError; P_term = KP_AMBIENT * currError; // keep control outputs between analogWrite bounds int control_output = (int) (I_term + P_term); if (control_output > 255) { control_output = 255; } else if (control_output < 0) { control_output = 0; } state_Now.duty_Ambient = control_output; return state_Now.duty_Ambient; } /* * int controllerFocal() * * runs control algorithm to maintain the heating rate at the focal * source to be at Ref_Temp_Change_Focal degrees/sec */ int Controller_Focal(float Ref_Temp_Change_Focal){ // local variables static float cumalitiveError = 0; // static variables persist b.t function calls static float lastError = 0; // static variables persist b.t function calls float currError; float P_term; float I_term; float D_term; int control_output; float dTemp = state_Now.temp_Focal - state_Last.temp_Focal; long dTime = (state_Now.time_Milli - state_Last.time_Milli); state_Now.rate_Focal = dTemp/(dTime/1000.0); // current error found by comparing reference temperature change with actual temp change currError = Ref_Temp_Change_Focal - state_Now.rate_Focal; // update cumalitive error cumalitiveError += currError; // prevent integrator wind-up if (cumalitiveError > FOCAL_INT_MAX) { cumalitiveError = FOCAL_INT_MAX; } else if (cumalitiveError < -FOCAL_INT_MAX) { cumalitiveError = -FOCAL_INT_MAX; } // PID P_term = KP_FOCAL * currError; I_term = KI_FOCAL * cumalitiveError; D_term = KD_FOCAL * (currError - lastError); // calculate control signal control_output = (int) (P_term + I_term + D_term); if (control_output > 255) { control_output = 255; } else if (control_output < 0) { control_output = 0; } state_Now.duty_Focal = control_output; // update the previous error lastError = currError; return state_Now.duty_Focal; } state_t MEASURE() { state_t state; //time, F temp ,F rate, A temp, dist, A duty, F duty , motion? running? state.time_Milli = millis() - start_millis; state.temp_Focal = readThermistor(inputPin_TempSensor_Focal); state.rate_Focal = ( state.temp_Focal - state_Last.temp_Focal ) / (state.time_Milli - state_Last.time_Milli) ; state.temp_Ambient = readThermistor(inputPin_TempSensor_Ambient); //TODO AVERAGE ALL AMBIENT THERMISTORS state.dist_Ultra = read_MS_Ultra(inputPin_MS_Echo,outputPin_MS_Trigger); state.duty_Ambient = Controller_Ambient(Ref_Temp_Ambient); state.duty_Focal = Controller_Focal(Ref_Temp_Change_Focal); //TODO check rate numbers state.motion_Detected = read_MotionSensors(inputPin_MS_Echo,inputPin_MS_Trigger,inputPin_MS_Reflect); //TODO combine motion sensors // // long time_Milli; // time at which state was measured // float temp_Focal; // glass temperature at the focal source // float rate_Focal ; // degrees per second heating rate of focal point // float temp_Ambient; // ambient temperature in the chamber // float dist_Ultra; // distance measured by ultrasonic sensor // int duty_Ambient; // duty that will be applied to ambient heaters // int duty_Focal; // duty that will be applied to focal heater // int motion_Detected; // outputs if we think there is motion : filters output from both ultrasonic and reflective sensors // int running; // running state - 1 or 0, return state; } /** * Calibrate the ultrasonic sensor with the distance to the stationary hand. * @param trigPin ultrasonic sensor * @param echoPin ultrasonic sensor * @param setupTimeS calibration time * @return average distance to stationary hand */ float Calibrate_Ultra(int TrigPin, int EchoPin, int setupTimeS) { int count = 0; long startTime; float dist_mm_calibrated = 0; setupTimeS *= 1000; // convert from seconds to milliseconds startTime = millis(); // get the start time digitalWrite(RED_LED_PIN, HIGH); while (millis() - startTime < setupTimeS) { dist_mm_calibrated += read_MS_Ultra(trigPin, echoPin); count++; } // average the calibrated value dist_mm_calibrated /= count; digitalWrite(RED_LED_PIN, LOW); return dist_mm_calibrated; } int read_MotionSensors(){ //TODO COMBINE READINGS FROM REFLECTIVE AND ULTRASONIC SENSORS TO RETURN A TRUE OR FALSE VALUE FOR THE HAND BEING PRESENT } int read_MS_Reflect(int pin){ return digitalRead(inputPin_MS_Reflect); } /** * Poll the ultrasonic sensor. * @param trigPin ultrasonic sensor * @param echoPin ultrasonic sensor * @return distance from sensor to object in mm */ float read_MS_Ultra(int TrigPin,int EchoPin){ float dist_mm; // distance in mm int duration_mcs; // duration in microseconds // Clears the TRIG_PIN digitalWrite(TrigPin, LOW); delayMicroseconds(2); // Sets the TRIG_PIN on HIGH state for 10 micro seconds digitalWrite(TrigPin, HIGH); delayMicroseconds(10); digitalWrite(TrigPin, LOW); // Reads the ECHO_PIN, returns the sound wave travel time in microseconds duration_mcs = pulseIn(EchoPin, HIGH); // Calculating the distance in mm dist_mm = duration_mcs * 0.034/2.0; return dist_mm; } float read_Thermistor(int pin){ float ROOM_TEMP_K = 298.15; float sensor_voltage = 5.0/1024.0 * (float) analogRead(pin); float Thermistor_R; if (abs(sensor_voltage - 2.5) < 0.0001) { Thermistor_R = 10000.0; } else { //Thermistor_R = R2_THERM * (sensor_voltage / 5.0) * (1.0 - (sensor_voltage / 5.0)); Thermistor_R = R_at_25DEG / ((1023.0/analogRead(pin)) - 1.0); } float tempK = 1.0 / ( (-1.0/BETA) * (log(Thermistor_R / 10000)) + (1.0 / ROOM_TEMP_K) ); float tempC = tempK - 273.0; return tempC; } } void shutdown(){ analogWrite(outputPin_Heat_Focal,0); state_Now.running = FALSE; } void write_LCD_message(char message){ //TODO write to top line :message: //https://www.arduino.cc/en/Tutorial/LiquidCrystalDisplay // liquid crystal libarry } void write_LCD_temp(float temp){ //TODO write to bottom line of LCD "Temp C: ##.##" } /* * void reset_ISR() * * @about: interrupt service routine for start button * @param: none * @return: none */ void reset_ISR() { // reset the test // buttonState = digitalRead(BUTTON_PIN); is this ever used? // if test has already completed, reset on interupt if (test_complete == TRUE){ state_Now.running = FALSE; test_complete = FALSE; } // if test is running, stop on interrupt else if (state_Now.running == TRUE) { state_Now.running = FALSE; } // if test is not running, start on interrupt else if (state_Now.running == TRUE) { state_Now.running = FALSE; } }
[ "noreply@github.com" ]
noreply@github.com
9eb63ef458bb2c7a5f6ec5125cf853b08780c622
1ec4921c64335185527eedbf4f23570a341e4b94
/src/FeistelFunction.cpp
47f73b3ef5c682db853e9f7bbc4965fcd897a65f
[]
no_license
paulina-szubarczyk/DES
3991be38b2eb8c51c437227381c41c8ff2f5c926
81b767e738f4efbf4d88229eae060dc91ce53184
refs/heads/master
2020-12-31T06:33:08.298190
2015-01-15T18:40:03
2015-01-15T18:40:03
28,404,172
1
0
null
null
null
null
UTF-8
C++
false
false
529
cpp
#include "FeistelFunction.h" #include <iostream> FeistelFunction::FeistelFunction() { // TODO Auto-generated constructor stub } uint64_t FeistelFunction::calculate(uint64_t Ri, uint64_t Ki) { // permutacja rozszerzająca E.expand(Ri); // std::cout << "R1: " << Ri << "\t" ; // suma modulo 2 z podkluczem Ri ^= Ki; // std::cout << "R2: " << Ri << "\t" ; // sboxy S.calculate(Ri); // std::cout << "R3: " << Ri << "\t" ; // permutacja feistela P.permutate(Ri); // std::cout << "R4: " << Ri << "\n" ; return Ri; }
[ "paulinaszubarczyk@gmail.com" ]
paulinaszubarczyk@gmail.com
33438404e934aeb12414eac15ffaa92d6f83276a
3cbea0497545c00ffc87fe1fa8a74dfe88dc9509
/2100_FindGoodDaystoRobtheBank.cpp
e6049a8e6c043afae8204685446a4926c56117b8
[]
no_license
yuhenghuang/Leetcode
40b954676feb3a2ef350188a6d86dadc44e84d71
3c5aafa7969a5a1eb01106676a5b94d404d07d9f
refs/heads/master
2023-08-30T18:17:16.209053
2023-08-25T01:05:49
2023-08-25T01:05:49
249,166,616
0
0
null
null
null
null
UTF-8
C++
false
false
635
cpp
#include <local_leetcode.hpp> class Solution { public: vector<int> goodDaysToRobBank(vector<int>& security, int time) { int n = security.size(); vector<int> dp(n); for (int i = n - 2; i >= 0; --i) if (security[i+1] >= security[i]) dp[i] = dp[i+1] + 1; int l; vector<int> res; for (int i = 0; i < n; ++i) { if (i > 0 && security[i-1] >= security[i]) ++l; else l = 0; if (l >= time && dp[i] >= time) res.push_back(i); } return res; } }; int main() { EXECS(Solution::goodDaysToRobBank); return 0; }
[ "kongqiota@gmail.com" ]
kongqiota@gmail.com
3f38bc70c3c062a8e0f63e04f3a6b7f4da8dbf25
65e8a612c6c45c481c450c9a965158872919c99d
/test/graph_bipartitioning/Strategy/StrategyBBGraphBipartitioning.h
54a099bb8c6166099ccd7565ebfce7b59b4a1467
[]
no_license
GoMani/pheet
aabb7dab06ab26ba12b7a8bb875b53cf2fe2afb5
374189d2fbe3de3db929b4e4b12d9642c38439e7
refs/heads/master
2021-01-18T05:07:28.957575
2013-10-21T14:17:40
2013-10-22T08:39:13
null
0
0
null
null
null
null
UTF-8
C++
false
false
6,128
h
/* * StrategyBBGraphBipartitioning.h * * Created on: Dec 5, 2011 * Author: Martin Wimmer * License: Boost Software License 1.0 (BSL1.0) */ #ifndef STRATEGYBBGRAPHBIPARTITIONING_H_ #define STRATEGYBBGRAPHBIPARTITIONING_H_ #include "../graph_helpers.h" #include "../Basic/BBGraphBipartitioningSubproblem.h" #include "../Basic/BBGraphBipartitioningLogic.h" #include "StrategyBBGraphBipartitioningDepthFirstBestStrategy.h" #include "StrategyBBGraphBipartitioningPerformanceCounters.h" #include "StrategyBBGraphBipartitioningTask.h" #include <iostream> namespace pheet { template <class Pheet, template <class P, class SP> class Logic, template <class P, class SubProblem> class SchedulingStrategy, size_t MaxSize = 64> class StrategyBBGraphBipartitioningImpl { public: typedef StrategyBBGraphBipartitioningImpl<Pheet, Logic, SchedulingStrategy, MaxSize> Self; typedef GraphBipartitioningSolution<MaxSize> Solution; typedef MaxReducer<Pheet, Solution> SolutionReducer; typedef StrategyBBGraphBipartitioningPerformanceCounters<Pheet> PerformanceCounters; typedef BBGraphBipartitioningSubproblem<Pheet, Logic, MaxSize> SubProblem; typedef StrategyBBGraphBipartitioningTask<Pheet, Logic, SchedulingStrategy, MaxSize> BBTask; template <template <class P, class SP> class NewLogic> using WithLogic = StrategyBBGraphBipartitioningImpl<Pheet, NewLogic, SchedulingStrategy, MaxSize>; template <template <class P, class SP> class NewStrat> using WithSchedulingStrategy = StrategyBBGraphBipartitioningImpl<Pheet, Logic, NewStrat, MaxSize>; template <size_t ms> using WithMaxSize = StrategyBBGraphBipartitioningImpl<Pheet, Logic, SchedulingStrategy, ms>; template <class P> using T = StrategyBBGraphBipartitioningImpl<P, Logic, SchedulingStrategy, MaxSize>; StrategyBBGraphBipartitioningImpl(GraphVertex* data, size_t size, Solution& solution, PerformanceCounters& pc); ~StrategyBBGraphBipartitioningImpl(); void operator()(); static void print_headers(); static void print_configuration(); static char const name[]; private: GraphVertex* data; size_t size; Solution& solution; PerformanceCounters pc; }; template <class Pheet, template <class P, class SubProblem> class Logic, template <class P, class SubProblem> class SchedulingStrategy, size_t MaxSize> char const StrategyBBGraphBipartitioningImpl<Pheet, Logic, SchedulingStrategy, MaxSize>::name[] = "StrategyBBGraphBipartitioning"; template <class Pheet, template <class P, class SubProblem> class Logic, template <class P, class SubProblem> class SchedulingStrategy, size_t MaxSize> StrategyBBGraphBipartitioningImpl<Pheet, Logic, SchedulingStrategy, MaxSize>::StrategyBBGraphBipartitioningImpl(GraphVertex* data, size_t size, Solution& solution, PerformanceCounters& pc) : data(data), size(size), solution(solution), pc(pc) { } template <class Pheet, template <class P, class SubProblem> class Logic, template <class P, class SubProblem> class SchedulingStrategy, size_t MaxSize> StrategyBBGraphBipartitioningImpl<Pheet, Logic, SchedulingStrategy, MaxSize>::~StrategyBBGraphBipartitioningImpl() { } template <class Pheet, template <class P, class SubProblem> class Logic, template <class P, class SubProblem> class SchedulingStrategy, size_t MaxSize> void StrategyBBGraphBipartitioningImpl<Pheet, Logic, SchedulingStrategy, MaxSize>::operator()() { SolutionReducer best; size_t ub = std::numeric_limits< size_t >::max(); size_t k = size >> 1; SubProblem* prob = new SubProblem(data, size, k, &ub); Pheet::template finish<BBTask>(prob, best, pc); solution = best.get_max(); pheet_assert(solution.weight == ub); pheet_assert(ub != std::numeric_limits< size_t >::max()); pheet_assert(solution.weight != std::numeric_limits< size_t >::max()); pheet_assert(solution.sets[0].count() == k); pheet_assert(solution.sets[1].count() == size - k); } /* template <class Pheet, template <class P, class SubProblem> class Logic, template <class P, class SubProblem> class SchedulingStrategy, size_t MaxSize> void StrategyBBGraphBipartitioningImpl<Pheet, Logic, SchedulingStrategy, MaxSize>::partition(SubProblem* sub_problem, size_t* upper_bound, SolutionReducer& best, PerformanceCounters& pc) { if(sub_problem->get_lower_bound() >= *upper_bound) { delete sub_problem; pc.num_irrelevant_tasks.incr(); return; } SchedulingStrategy<Pheet, SubProblem> strategy; SubProblem* sub_problem2 = sub_problem->split(pc.subproblem_pc); if(sub_problem->is_solution()) { sub_problem->update_solution(upper_bound, best, pc.subproblem_pc); delete sub_problem; } else if(sub_problem->get_lower_bound() < *upper_bound) { Pheet::spawn_prio(strategy(sub_problem, upper_bound), Self::partition, sub_problem, upper_bound, std::move(SolutionReducer(best)), std::move(PerformanceCounters(pc))); } else { delete sub_problem; } if(sub_problem2->is_solution()) { sub_problem2->update_solution(upper_bound, best, pc.subproblem_pc); delete sub_problem2; } else if(sub_problem2->get_lower_bound() < *upper_bound) { Pheet::spawn_prio(strategy(sub_problem2, upper_bound), partition, sub_problem2, upper_bound, best, pc); } else { delete sub_problem2; } }*/ template <class Pheet, template <class P, class SubProblem> class Logic, template <class P, class SubProblem> class SchedulingStrategy, size_t MaxSize> void StrategyBBGraphBipartitioningImpl<Pheet, Logic, SchedulingStrategy, MaxSize>::print_configuration() { Logic<Pheet, SubProblem>::print_name(); std::cout << "\t"; SchedulingStrategy<Pheet, SubProblem>::print_name(); std::cout << "\t"; } template <class Pheet, template <class P, class SubProblem> class Logic, template <class P, class SubProblem> class SchedulingStrategy, size_t MaxSize> void StrategyBBGraphBipartitioningImpl<Pheet, Logic, SchedulingStrategy, MaxSize>::print_headers() { std::cout << "logic\tstrategy\t"; } template <class Pheet = Pheet> using StrategyBBGraphBipartitioning = StrategyBBGraphBipartitioningImpl<Pheet, BBGraphBipartitioningLogic, StrategyBBGraphBipartitioningDepthFirstBestStrategy, 64>; } #endif /* STRATEGYBBGRAPHBIPARTITIONING_H_ */
[ "martin@wimmer.co.uk" ]
martin@wimmer.co.uk
5df756d0d0ba0b2383e38288d2489ce607ecde36
37cca16f12e7b1d4d01d6f234da6d568c318abee
/src/rice/p2p/util/testing/SecurityUtilsUnit-main.cpp
0bd6cc02e4c147e55f7258a258fe6d921edf456e
[]
no_license
subhash1-0/thirstyCrow
e48155ce68fc886f2ee8e7802567c1149bc54206
78b7e4e3d2b9a9530ad7d66b44eacfe73ceea582
refs/heads/master
2016-09-06T21:25:54.075724
2015-09-21T17:21:15
2015-09-21T17:21:15
42,881,521
0
0
null
null
null
null
UTF-8
C++
false
false
303
cpp
#include <rice/p2p/util/testing/SecurityUtilsUnit.hpp> extern void init_jvm(); extern java::lang::StringArray* make_args(int args, char** argv); int main(int argc, char** argv) { init_jvm(); ::rice::p2p::util::testing::SecurityUtilsUnit::main(make_args(argc, argv)); return 0; }
[ "sgurjar@adobe.com" ]
sgurjar@adobe.com
254b9578cc44e778b7036c0bb7115acc045bb385
4a634ad6eddcc372b7b02f0e0dfef93b74ac2879
/acm/oj/codeforce/problems/ac/888d.cpp
4b69a9c00a39721936129d835fa1c37bed1d668b
[]
no_license
chilogen/workspace
6e46d0724f7ce4f932a2c904e82d5cc6a6237e14
31f780d8e7c7020dbdece7f96a628ae8382c2703
refs/heads/master
2021-01-25T13:36:36.574867
2019-02-18T14:25:13
2019-02-18T14:25:13
123,596,604
1
0
null
null
null
null
UTF-8
C++
false
false
1,838
cpp
/*we need to find the number of permutation 1~n that have *least (n minus k)'s position p[i]=i. *just forget that problem a moment.if every player have his own shit *in the lounge,after the game,you are the one who look after those shit *so after the game,you should give everyone his owm shit,but you want to *make a joke,just every on can gave his own shit.how many way to do it? *you can pick p1 a random shit not belong to he(if it is p2's shit),it have *n-1 choice,and then you give a random shit to p2(now you can give any shit to *he,because his shit have been give to p1),so you also have n-1 choice. *now,just let m[x] identity the number that the number of method to give everyone *shit no belong to him,so m[x]=m[x-2](give p2 p1's shit)+(x-2)*dp[x-2](do not give *p2 p1's shit),and the dp[i]=dp[i-1]+(i-2)*m[i-1](give p3 p1's shit and don't give *p3 p1's shit),it just the mean of m in the code. * *now go back the problem,we can choose x positions that p[i]=i,and let the reamin *positions p[i]!=i,just add x from n-k to n,we can get the answer.we can use the *method above to get the num of p[i]!=i,and use combination to get the num of p[i]=i *luckly in this problem,1<=k<=4,so we can calculate m first use brute force but not *recursive. //brute force: int cnt=0,a[10],i,n; cin>>n; for(i=0;i<n;i++) a[i]=i; do { for(i=0;i<n;i++) if(a[i]==i) break; if(i==n) cnt++; }while(next_permutation(a,a+n)); cout<<cnt<<endl; *that is why m[6]={0,0,1,2,9,44}; */ #include <bits/stdc++.h> using namespace std; typedef long long LL; LL ans=0,n,k,c[1010][1010]={0},m[6]={0,0,1,2,9,44}; int main() { LL n,k,i,j; cin>>n>>k; c[0][0]=1; for(i=1;i<=1000;i++) { c[i][0]=1; for(j=1;j<=i;j++) c[i][j]=c[i-1][j-1]+c[i-1][j]; } for(j=n-k;j<=n-2;j++) { ans+=c[n][j]*m[n-j]; } ans++; cout<<ans<<endl; return 0; }
[ "quantu_zo@yahoo.com" ]
quantu_zo@yahoo.com
cae4f6901017a69a8e7ed18a7ae649b896ba094e
5b905bc91236233b9705e0e56026b610ade7108a
/tf_pose/pafprocess/pafprocess_3.h
2c91614e4741bcc16f68633cf791b5bf52c9fafd
[ "Apache-2.0" ]
permissive
jovialio/tf-pose-estimation
e328536f14784a38bb117a18097d986c69d1698f
38ffcf1f31dfc129fcefc4e2452bbc36974620b8
refs/heads/master
2020-04-11T10:50:54.696094
2020-02-28T05:18:46
2020-02-28T05:18:46
161,728,287
0
0
Apache-2.0
2018-12-14T03:45:39
2018-12-14T03:45:39
null
UTF-8
C++
false
false
1,409
h
#include <vector> #ifndef PAFPROCESS #define PAFPROCESS const float THRESH_HEAT = 0.05; const float THRESH_VECTOR_SCORE = 0.05; const int THRESH_VECTOR_CNT1 = 9; const int THRESH_PART_CNT = 4; const float THRESH_HUMAN_SCORE = 0.4; const int NUM_PART = 18; const int STEP_PAF = 10; const int COCOPAIRS_SIZE = 19; const int COCOPAIRS_NET[COCOPAIRS_SIZE][2] = { {12, 13}, {20, 21}, {14, 15}, {16, 17}, {22, 23}, {24, 25}, {0, 1}, {2, 3}, {4, 5}, {6, 7}, {8, 9}, {10, 11}, {28, 29}, {30, 31}, {34, 35}, {32, 33}, {36, 37}, {18, 19}, {26, 27} }; const int COCOPAIRS[COCOPAIRS_SIZE][2] = { {1, 2}, {1, 5}, {2, 3}, {3, 4}, {5, 6}, {6, 7}, {1, 8}, {8, 9}, {9, 10}, {1, 11}, {11, 12}, {12, 13}, {1, 0}, {0, 14}, {14, 16}, {0, 15}, {15, 17}, {2, 16}, {5, 17} }; struct Peak { int x; int y; float score; int id; }; struct VectorXY { float x; float y; }; struct ConnectionCandidate { int idx1; int idx2; float score; float etc; }; struct Connection { int cid1; int cid2; float score; int peak_id1; int peak_id2; }; int process_paf(int p1, int p2, int p3, float *peaks, int h1, int h2, int h3, float *heatmap, int f1, int f2, int f3, float *pafmap); int get_num_humans(); int get_part_cid(int human_id, int part_id); float get_score(int human_id); int get_part_x(int cid); int get_part_y(int cid); float get_part_score(int cid); #endif
[ "dennischewkt@gmail.com" ]
dennischewkt@gmail.com
1d0a4c823d12f33a107a0e7aa8771e33246a4f54
731d0d3e1d1cc11f31ca8f8c0aa7951814052c15
/InetSpeed/Generated Files/winrt/impl/Windows.Foundation.Collections.2.h
20e061381685d07ca56ac8d15cca9c019e47184e
[]
no_license
serzh82saratov/InetSpeedCppWinRT
07623c08b5c8135c7d55c17fed1164c8d9e56c8f
e5051f8c44469bbed0488c1d38731afe874f8c1f
refs/heads/master
2022-04-20T05:48:22.203411
2020-04-02T19:36:13
2020-04-02T19:36:13
null
0
0
null
null
null
null
UTF-8
C++
false
false
3,465
h
// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.200316.3 #ifndef WINRT_Windows_Foundation_Collections_2_H #define WINRT_Windows_Foundation_Collections_2_H #include "winrt/impl/Windows.Foundation.Collections.1.h" WINRT_EXPORT namespace winrt::Windows::Foundation::Collections { template <typename K, typename V> struct MapChangedEventHandler : Windows::Foundation::IUnknown { static_assert(impl::has_category_v<K>, "K must be WinRT type."); static_assert(impl::has_category_v<V>, "V must be WinRT type."); MapChangedEventHandler(std::nullptr_t = nullptr) noexcept {} MapChangedEventHandler(void* ptr, take_ownership_from_abi_t) noexcept : Windows::Foundation::IUnknown(ptr, take_ownership_from_abi) {} template <typename L> MapChangedEventHandler(L lambda); template <typename F> MapChangedEventHandler(F* function); template <typename O, typename M> MapChangedEventHandler(O* object, M method); template <typename O, typename M> MapChangedEventHandler(com_ptr<O>&& object, M method); template <typename O, typename M> MapChangedEventHandler(weak_ref<O>&& object, M method); auto operator()(Windows::Foundation::Collections::IObservableMap<K, V> const& sender, Windows::Foundation::Collections::IMapChangedEventArgs<K> const& event) const; }; template <typename T> struct VectorChangedEventHandler : Windows::Foundation::IUnknown { static_assert(impl::has_category_v<T>, "T must be WinRT type."); VectorChangedEventHandler(std::nullptr_t = nullptr) noexcept {} VectorChangedEventHandler(void* ptr, take_ownership_from_abi_t) noexcept : Windows::Foundation::IUnknown(ptr, take_ownership_from_abi) {} template <typename L> VectorChangedEventHandler(L lambda); template <typename F> VectorChangedEventHandler(F* function); template <typename O, typename M> VectorChangedEventHandler(O* object, M method); template <typename O, typename M> VectorChangedEventHandler(com_ptr<O>&& object, M method); template <typename O, typename M> VectorChangedEventHandler(weak_ref<O>&& object, M method); auto operator()(Windows::Foundation::Collections::IObservableVector<T> const& sender, Windows::Foundation::Collections::IVectorChangedEventArgs const& event) const; }; struct __declspec(empty_bases) PropertySet : Windows::Foundation::Collections::IPropertySet { PropertySet(std::nullptr_t) noexcept {} PropertySet(void* ptr, take_ownership_from_abi_t) noexcept : Windows::Foundation::Collections::IPropertySet(ptr, take_ownership_from_abi) {} PropertySet(); }; struct __declspec(empty_bases) StringMap : Windows::Foundation::Collections::IMap<hstring, hstring>, impl::require<StringMap, Windows::Foundation::Collections::IObservableMap<hstring, hstring>> { StringMap(std::nullptr_t) noexcept {} StringMap(void* ptr, take_ownership_from_abi_t) noexcept : Windows::Foundation::Collections::IMap<hstring, hstring>(ptr, take_ownership_from_abi) {} StringMap(); }; struct __declspec(empty_bases) ValueSet : Windows::Foundation::Collections::IPropertySet { ValueSet(std::nullptr_t) noexcept {} ValueSet(void* ptr, take_ownership_from_abi_t) noexcept : Windows::Foundation::Collections::IPropertySet(ptr, take_ownership_from_abi) {} ValueSet(); }; } #endif
[ "ctorre@microsoft.com" ]
ctorre@microsoft.com
f217eee358e9d3d19ece6b9602bf767c9e54fff4
1733de50df4219fefab4c0b332f72a869861bada
/chatbot/stdafx.cpp
a7e7f74c417b28467b0aa08a69989c535e4c85bf
[]
no_license
Zybala/ChatBot
cb9e67fb048d8b0dce25fc78e00f3c8c1bdf9832
085838f0ce88cfcadfdd644d0784821147fc90c1
refs/heads/master
2021-01-11T15:01:15.558645
2017-01-31T01:24:06
2017-01-31T01:24:06
80,280,206
0
0
null
null
null
null
UTF-8
C++
false
false
286
cpp
// stdafx.cpp : source file that includes just the standard includes // chatbot.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information #include "stdafx.h" // TODO: reference any additional headers you need in STDAFX.H // and not in this file
[ "Khunzybla@gmail.com" ]
Khunzybla@gmail.com
5cf280fe83cb9fb53406dda233933c1f48fcbd11
6fc57553a02b485ad20c6e9a65679cd71fa0a35d
/examples/media/audio/effects/dfx_base.h
5d60cd01919908168de9adf1bb19dc1099fa12d0
[ "BSD-3-Clause" ]
permissive
OpenTrustGroup/fuchsia
2c782ac264054de1a121005b4417d782591fb4d8
647e593ea661b8bf98dcad2096e20e8950b24a97
refs/heads/master
2023-01-23T08:12:32.214842
2019-08-03T20:27:06
2019-08-03T20:27:06
178,452,475
1
1
BSD-3-Clause
2023-01-05T00:43:10
2019-03-29T17:53:42
C++
UTF-8
C++
false
false
2,370
h
// Copyright 2018 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Refer to the accompanying README.md file for detailed API documentation // (functions, structs and constants). #ifndef EXAMPLES_MEDIA_AUDIO_EFFECTS_DFX_BASE_H_ #define EXAMPLES_MEDIA_AUDIO_EFFECTS_DFX_BASE_H_ #include <lib/media/audio_dfx/cpp/audio_device_fx.h> #include <stdint.h> #include <memory> namespace media::audio_dfx_test { enum Effect : uint32_t { Delay = 0, Rechannel = 1, Swap = 2, Count = 3 }; class DfxBase { public: static constexpr uint16_t kNumTestEffects = Effect::Count; static bool GetNumEffects(uint32_t* num_effects_out); static bool GetInfo(uint32_t effect_id, fuchsia_audio_dfx_description* dfx_desc); static bool GetControlInfo(uint32_t effect_id, uint16_t control_num, fuchsia_audio_dfx_control_description* dfx_control_desc); static DfxBase* Create(uint32_t effect_id, uint32_t frame_rate, uint16_t channels_in, uint16_t channels_out); DfxBase(uint32_t effect_id, uint16_t num_controls, uint32_t frame_rate, uint16_t channels_in, uint16_t channels_out, uint32_t frames_latency, uint32_t suggested_buff_frames) : effect_id_(effect_id), num_controls_(num_controls), frame_rate_(frame_rate), channels_in_(channels_in), channels_out_(channels_out), frames_latency_(frames_latency), suggested_buff_frames_(suggested_buff_frames) {} virtual ~DfxBase() = default; bool GetParameters(fuchsia_audio_dfx_parameters* device_fx_params); virtual bool GetControlValue(uint16_t, float*) { return false; } virtual bool SetControlValue(uint16_t, float) { return false; } virtual bool Reset() { return true; } virtual bool ProcessInplace(uint32_t, float*) { return false; } virtual bool Process(uint32_t, const float*, float*) { return false; } virtual bool Flush() { return true; } uint16_t num_controls() { return num_controls_; } protected: uint32_t effect_id_; uint16_t num_controls_; uint32_t frame_rate_; uint16_t channels_in_; uint16_t channels_out_; uint32_t frames_latency_; uint32_t suggested_buff_frames_; }; } // namespace media::audio_dfx_test #endif // EXAMPLES_MEDIA_AUDIO_EFFECTS_DFX_BASE_H_
[ "commit-bot@chromium.org" ]
commit-bot@chromium.org
c1700321574b47d012653bb82dcf628eb8644819
032a44c3e0a7dc77271bb2213467154212a4e5d3
/src/mprmpr/util/striped64.cc
09c81404f319a56fa6e7027cdbbe55513e3a90e1
[]
no_license
wqx081/mpr_mpr
94f557e4d1ec696e880f93ce68ce57594da5a11c
cd0546e38f92576df73714088bc59e7f59b645d2
refs/heads/master
2021-01-12T10:25:03.208531
2016-12-21T14:53:15
2016-12-21T14:53:15
76,452,236
1
1
null
null
null
null
UTF-8
C++
false
false
4,785
cc
#include "mprmpr/util/monotime.h" #include "mprmpr/util/random.h" #include "mprmpr/util/striped64.h" #include "mprmpr/util/threadlocal.h" using mprmpr::striped64::internal::HashCode; using mprmpr::striped64::internal::Cell; namespace mprmpr { namespace striped64 { namespace internal { // // HashCode // HashCode::HashCode() { Random r((MonoTime::Now() - MonoTime::Min()).ToNanoseconds()); const uint64_t hash = r.Next64(); code_ = (hash == 0) ? 1 : hash; // Avoid zero to allow xorShift rehash } // // Cell // Cell::Cell() : value_(0) { } } // namespace internal } // namespace striped64 // // Striped64 // const uint32_t Striped64::kNumCpus = sysconf(_SC_NPROCESSORS_ONLN); DEFINE_STATIC_THREAD_LOCAL(HashCode, Striped64, hashcode_); Striped64::Striped64() : busy_(false), cell_buffer_(nullptr), cells_(nullptr), num_cells_(0) { } Striped64::~Striped64() { // Cell is a POD, so no need to destruct each one. free(cell_buffer_); } void Striped64::RetryUpdate(int64_t x, Rehash contention) { uint64_t h = hashcode_->code_; // There are three operations in this loop. // // 1. Try to add to the Cell hash table entry for the thread if the table exists. // When there's contention, rehash to try a different Cell. // 2. Try to initialize the hash table. // 3. Try to update the base counter. // // These are predicated on successful CAS operations, which is why it's all wrapped in an // infinite retry loop. while (true) { int32_t n = base::subtle::Acquire_Load(&num_cells_); if (n > 0) { if (contention == kRehash) { // CAS failed already, rehash before trying to increment. contention = kNoRehash; } else { Cell *cell = &(cells_[(n - 1) & h]); int64_t v = cell->value_.Load(); if (cell->CompareAndSet(v, Fn(v, x))) { // Successfully CAS'd the corresponding cell, done. break; } } // Rehash since we failed to CAS, either previously or just now. h ^= h << 13; h ^= h >> 17; h ^= h << 5; } else if (n == 0 && CasBusy()) { // We think table hasn't been initialized yet, try to do so. // Recheck preconditions, someone else might have init'd in the meantime. n = base::subtle::Acquire_Load(&num_cells_); if (n == 0) { n = 1; // Calculate the size. Nearest power of two >= NCPU. // Also handle a negative NCPU, can happen if sysconf name is unknown while ((int)kNumCpus > n) { n <<= 1; } // Allocate cache-aligned memory for use by the cells_ table. int err = posix_memalign(&cell_buffer_, CACHELINE_SIZE, sizeof(Cell)*n); CHECK_EQ(0, err) << "error calling posix_memalign" << std::endl; // Initialize the table cells_ = new (cell_buffer_) Cell[n]; base::subtle::Release_Store(&num_cells_, n); } // End critical section busy_.Store(0); } else { // Fallback to adding to the base value. // Means the table wasn't initialized or we failed to init it. int64_t v = base_.value_.Load(); if (CasBase(v, Fn(v, x))) { break; } } } // Record index for next time hashcode_->code_ = h; } void Striped64::InternalReset(int64_t initialValue) { const int32_t n = base::subtle::Acquire_Load(&num_cells_); base_.value_.Store(initialValue); for (int i = 0; i < n; i++) { cells_[i].value_.Store(initialValue); } } void LongAdder::IncrementBy(int64_t x) { INIT_STATIC_THREAD_LOCAL(HashCode, hashcode_); // Use hash table if present. If that fails, call RetryUpdate to rehash and retry. // If no hash table, try to CAS the base counter. If that fails, RetryUpdate to init the table. const int32_t n = base::subtle::Acquire_Load(&num_cells_); if (n > 0) { Cell *cell = &(cells_[(n - 1) & hashcode_->code_]); DCHECK_EQ(0, reinterpret_cast<const uintptr_t>(cell) & (sizeof(Cell) - 1)) << " unaligned Cell not allowed for Striped64" << std::endl; const int64_t old = cell->value_.Load(); if (!cell->CompareAndSet(old, old + x)) { // When we hit a hash table contention, signal RetryUpdate to rehash. RetryUpdate(x, kRehash); } } else { int64_t b = base_.value_.Load(); if (!base_.CompareAndSet(b, b + x)) { // Attempt to initialize the table. No need to rehash since the contention was for the // base counter, not the hash table. RetryUpdate(x, kNoRehash); } } } // // LongAdder // int64_t LongAdder::Value() const { int64_t sum = base_.value_.Load(); const int32_t n = base::subtle::Acquire_Load(&num_cells_); for (int i = 0; i < n; i++) { sum += cells_[i].value_.Load(); } return sum; } } // namespace mprmpr
[ "you@example.com" ]
you@example.com
469ece50b9a368efc010b80d743551d078cb1665
58f46a28fc1b58f9cd4904c591b415c29ab2842f
/chromium-32.0.1700.107/content/browser/renderer_host/render_widget_host_view_aura.cc
d2c0a489fa0b877d0ca043cf9fd20b872c5f7aaa
[ "BSD-3-Clause" ]
permissive
bbmjja8123/chromium-1
e739ef69d176c636d461e44d54ec66d11ed48f96
2a46d8855c48acd51dafc475be7a56420a716477
refs/heads/master
2021-01-16T17:50:45.184775
2015-03-20T18:38:11
2015-03-20T18:42:06
null
0
0
null
null
null
null
UTF-8
C++
false
false
122,573
cc
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "content/browser/renderer_host/render_widget_host_view_aura.h" #include "base/basictypes.h" #include "base/bind.h" #include "base/callback_helpers.h" #include "base/command_line.h" #include "base/debug/trace_event.h" #include "base/logging.h" #include "base/message_loop/message_loop.h" #include "base/strings/string_number_conversions.h" #include "cc/layers/delegated_frame_provider.h" #include "cc/output/compositor_frame.h" #include "cc/output/compositor_frame_ack.h" #include "cc/output/copy_output_request.h" #include "cc/output/copy_output_result.h" #include "cc/resources/texture_mailbox.h" #include "cc/trees/layer_tree_settings.h" #include "content/browser/accessibility/browser_accessibility_manager.h" #include "content/browser/accessibility/browser_accessibility_state_impl.h" #include "content/browser/aura/compositor_resize_lock.h" #include "content/browser/gpu/compositor_util.h" #include "content/browser/renderer_host/backing_store_aura.h" #include "content/browser/renderer_host/dip_util.h" #include "content/browser/renderer_host/overscroll_controller.h" #include "content/browser/renderer_host/render_view_host_delegate.h" #include "content/browser/renderer_host/render_widget_host_impl.h" #include "content/browser/renderer_host/touch_smooth_scroll_gesture_aura.h" #include "content/browser/renderer_host/ui_events_helper.h" #include "content/browser/renderer_host/web_input_event_aura.h" #include "content/common/gpu/client/gl_helper.h" #include "content/common/gpu/gpu_messages.h" #include "content/common/view_messages.h" #include "content/port/browser/render_widget_host_view_frame_subscriber.h" #include "content/port/browser/render_widget_host_view_port.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/content_browser_client.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/user_metrics.h" #include "content/public/common/content_switches.h" #include "media/base/video_util.h" #include "skia/ext/image_operations.h" #include "third_party/WebKit/public/web/WebCompositionUnderline.h" #include "third_party/WebKit/public/web/WebInputEvent.h" #include "third_party/WebKit/public/web/WebScreenInfo.h" #include "ui/aura/client/activation_client.h" #include "ui/aura/client/aura_constants.h" #include "ui/aura/client/cursor_client.h" #include "ui/aura/client/cursor_client_observer.h" #include "ui/aura/client/focus_client.h" #include "ui/aura/client/screen_position_client.h" #include "ui/aura/client/tooltip_client.h" #include "ui/aura/client/window_tree_client.h" #include "ui/aura/client/window_types.h" #include "ui/aura/env.h" #include "ui/aura/root_window.h" #include "ui/aura/window.h" #include "ui/aura/window_observer.h" #include "ui/aura/window_tracker.h" #include "ui/base/clipboard/scoped_clipboard_writer.h" #include "ui/base/hit_test.h" #include "ui/base/ime/input_method.h" #include "ui/base/ui_base_types.h" #include "ui/compositor/layer.h" #include "ui/events/event.h" #include "ui/events/event_utils.h" #include "ui/events/gestures/gesture_recognizer.h" #include "ui/gfx/canvas.h" #include "ui/gfx/display.h" #include "ui/gfx/rect_conversions.h" #include "ui/gfx/screen.h" #include "ui/gfx/size_conversions.h" #include "ui/gfx/skia_util.h" #if defined(OS_WIN) #include "base/win/windows_version.h" #include "content/browser/accessibility/browser_accessibility_manager_win.h" #include "content/browser/accessibility/browser_accessibility_win.h" #include "content/common/plugin_constants_win.h" #include "ui/base/win/hidden_window.h" #include "ui/gfx/gdi_util.h" #include "ui/gfx/win/dpi.h" #endif using gfx::RectToSkIRect; using gfx::SkIRectToRect; using WebKit::WebScreenInfo; using WebKit::WebTouchEvent; namespace content { namespace { void MailboxReleaseCallback(scoped_ptr<base::SharedMemory> shared_memory, unsigned sync_point, bool lost_resource) { // NOTE: shared_memory will get released when we go out of scope. } // In mouse lock mode, we need to prevent the (invisible) cursor from hitting // the border of the view, in order to get valid movement information. However, // forcing the cursor back to the center of the view after each mouse move // doesn't work well. It reduces the frequency of useful mouse move messages // significantly. Therefore, we move the cursor to the center of the view only // if it approaches the border. |kMouseLockBorderPercentage| specifies the width // of the border area, in percentage of the corresponding dimension. const int kMouseLockBorderPercentage = 15; // When accelerated compositing is enabled and a widget resize is pending, // we delay further resizes of the UI. The following constant is the maximum // length of time that we should delay further UI resizes while waiting for a // resized frame from a renderer. const int kResizeLockTimeoutMs = 67; #if defined(OS_WIN) // Used to associate a plugin HWND with its RenderWidgetHostViewAura instance. const wchar_t kWidgetOwnerProperty[] = L"RenderWidgetHostViewAuraOwner"; BOOL CALLBACK WindowDestroyingCallback(HWND window, LPARAM param) { RenderWidgetHostViewAura* widget = reinterpret_cast<RenderWidgetHostViewAura*>(param); if (GetProp(window, kWidgetOwnerProperty) == widget) { // Properties set on HWNDs must be removed to avoid leaks. RemoveProp(window, kWidgetOwnerProperty); RenderWidgetHostViewBase::DetachPluginWindowsCallback(window); } return TRUE; } BOOL CALLBACK HideWindowsCallback(HWND window, LPARAM param) { RenderWidgetHostViewAura* widget = reinterpret_cast<RenderWidgetHostViewAura*>(param); if (GetProp(window, kWidgetOwnerProperty) == widget) SetParent(window, ui::GetHiddenWindow()); return TRUE; } BOOL CALLBACK ShowWindowsCallback(HWND window, LPARAM param) { RenderWidgetHostViewAura* widget = reinterpret_cast<RenderWidgetHostViewAura*>(param); if (GetProp(window, kWidgetOwnerProperty) == widget && widget->GetNativeView()->GetDispatcher()) { HWND parent = widget->GetNativeView()->GetDispatcher()->GetAcceleratedWidget(); SetParent(window, parent); } return TRUE; } struct CutoutRectsParams { RenderWidgetHostViewAura* widget; std::vector<gfx::Rect> cutout_rects; std::map<HWND, WebPluginGeometry>* geometry; }; // Used to update the region for the windowed plugin to draw in. We start with // the clip rect from the renderer, then remove the cutout rects from the // renderer, and then remove the transient windows from the root window and the // constrained windows from the parent window. BOOL CALLBACK SetCutoutRectsCallback(HWND window, LPARAM param) { CutoutRectsParams* params = reinterpret_cast<CutoutRectsParams*>(param); if (GetProp(window, kWidgetOwnerProperty) == params->widget) { // First calculate the offset of this plugin from the root window, since // the cutouts are relative to the root window. HWND parent = params->widget->GetNativeView()->GetDispatcher()-> GetAcceleratedWidget(); POINT offset; offset.x = offset.y = 0; MapWindowPoints(window, parent, &offset, 1); // Now get the cached clip rect and cutouts for this plugin window that came // from the renderer. std::map<HWND, WebPluginGeometry>::iterator i = params->geometry->begin(); while (i != params->geometry->end() && i->second.window != window && GetParent(i->second.window) != window) { ++i; } if (i == params->geometry->end()) { NOTREACHED(); return TRUE; } HRGN hrgn = CreateRectRgn(i->second.clip_rect.x(), i->second.clip_rect.y(), i->second.clip_rect.right(), i->second.clip_rect.bottom()); // We start with the cutout rects that came from the renderer, then add the // ones that came from transient and constrained windows. std::vector<gfx::Rect> cutout_rects = i->second.cutout_rects; for (size_t i = 0; i < params->cutout_rects.size(); ++i) { gfx::Rect offset_cutout = params->cutout_rects[i]; offset_cutout.Offset(-offset.x, -offset.y); cutout_rects.push_back(offset_cutout); } gfx::SubtractRectanglesFromRegion(hrgn, cutout_rects); SetWindowRgn(window, hrgn, TRUE); } return TRUE; } // A callback function for EnumThreadWindows to enumerate and dismiss // any owned popup windows. BOOL CALLBACK DismissOwnedPopups(HWND window, LPARAM arg) { const HWND toplevel_hwnd = reinterpret_cast<HWND>(arg); if (::IsWindowVisible(window)) { const HWND owner = ::GetWindow(window, GW_OWNER); if (toplevel_hwnd == owner) { ::PostMessage(window, WM_CANCELMODE, 0, 0); } } return TRUE; } #endif void UpdateWebTouchEventAfterDispatch(WebKit::WebTouchEvent* event, WebKit::WebTouchPoint* point) { if (point->state != WebKit::WebTouchPoint::StateReleased && point->state != WebKit::WebTouchPoint::StateCancelled) return; --event->touchesLength; for (unsigned i = point - event->touches; i < event->touchesLength; ++i) { event->touches[i] = event->touches[i + 1]; } } bool CanRendererHandleEvent(const ui::MouseEvent* event) { if (event->type() == ui::ET_MOUSE_CAPTURE_CHANGED) return false; #if defined(OS_WIN) // Renderer cannot handle WM_XBUTTON or NC events. switch (event->native_event().message) { case WM_XBUTTONDOWN: case WM_XBUTTONUP: case WM_XBUTTONDBLCLK: case WM_NCMOUSELEAVE: case WM_NCMOUSEMOVE: case WM_NCLBUTTONDOWN: case WM_NCLBUTTONUP: case WM_NCLBUTTONDBLCLK: case WM_NCRBUTTONDOWN: case WM_NCRBUTTONUP: case WM_NCRBUTTONDBLCLK: case WM_NCMBUTTONDOWN: case WM_NCMBUTTONUP: case WM_NCMBUTTONDBLCLK: case WM_NCXBUTTONDOWN: case WM_NCXBUTTONUP: case WM_NCXBUTTONDBLCLK: return false; default: break; } #endif return true; } // We don't mark these as handled so that they're sent back to the // DefWindowProc so it can generate WM_APPCOMMAND as necessary. bool IsXButtonUpEvent(const ui::MouseEvent* event) { #if defined(OS_WIN) switch (event->native_event().message) { case WM_XBUTTONUP: case WM_NCXBUTTONUP: return true; } #endif return false; } void GetScreenInfoForWindow(WebScreenInfo* results, aura::Window* window) { const gfx::Display display = window ? gfx::Screen::GetScreenFor(window)->GetDisplayNearestWindow(window) : gfx::Screen::GetScreenFor(window)->GetPrimaryDisplay(); results->rect = display.bounds(); results->availableRect = display.work_area(); // TODO(derat|oshima): Don't hardcode this. Get this from display object. results->depth = 24; results->depthPerComponent = 8; results->deviceScaleFactor = display.device_scale_factor(); } bool ShouldSendPinchGesture() { #if defined(OS_WIN) if (base::win::GetVersion() >= base::win::VERSION_WIN8) return true; #endif static bool pinch_allowed = CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableViewport) || CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnablePinch); return pinch_allowed; } bool PointerEventActivates(const ui::Event& event) { if (event.type() == ui::ET_MOUSE_PRESSED) return true; if (event.type() == ui::ET_GESTURE_BEGIN) { const ui::GestureEvent& gesture = static_cast<const ui::GestureEvent&>(event); return gesture.details().touch_points() == 1; } return false; } // Swap ack for the renderer when kCompositeToMailbox is enabled. void SendCompositorFrameAck( int32 route_id, uint32 output_surface_id, int renderer_host_id, const gpu::Mailbox& received_mailbox, const gfx::Size& received_size, bool skip_frame, const scoped_refptr<ui::Texture>& texture_to_produce) { cc::CompositorFrameAck ack; ack.gl_frame_data.reset(new cc::GLFrameData()); DCHECK(!texture_to_produce.get() || !skip_frame); if (texture_to_produce.get()) { std::string mailbox_name = texture_to_produce->Produce(); std::copy(mailbox_name.data(), mailbox_name.data() + mailbox_name.length(), reinterpret_cast<char*>(ack.gl_frame_data->mailbox.name)); ack.gl_frame_data->size = texture_to_produce->size(); ack.gl_frame_data->sync_point = content::ImageTransportFactory::GetInstance()->InsertSyncPoint(); } else if (skip_frame) { // Skip the frame, i.e. tell the producer to reuse the same buffer that // we just received. ack.gl_frame_data->size = received_size; ack.gl_frame_data->mailbox = received_mailbox; } RenderWidgetHostImpl::SendSwapCompositorFrameAck( route_id, output_surface_id, renderer_host_id, ack); } void AcknowledgeBufferForGpu( int32 route_id, int gpu_host_id, const std::string& received_mailbox, bool skip_frame, const scoped_refptr<ui::Texture>& texture_to_produce) { AcceleratedSurfaceMsg_BufferPresented_Params ack; uint32 sync_point = 0; DCHECK(!texture_to_produce.get() || !skip_frame); if (texture_to_produce.get()) { ack.mailbox_name = texture_to_produce->Produce(); sync_point = content::ImageTransportFactory::GetInstance()->InsertSyncPoint(); } else if (skip_frame) { ack.mailbox_name = received_mailbox; ack.sync_point = 0; } ack.sync_point = sync_point; RenderWidgetHostImpl::AcknowledgeBufferPresent( route_id, gpu_host_id, ack); } } // namespace // We need to watch for mouse events outside a Web Popup or its parent // and dismiss the popup for certain events. class RenderWidgetHostViewAura::EventFilterForPopupExit : public ui::EventHandler { public: explicit EventFilterForPopupExit(RenderWidgetHostViewAura* rwhva) : rwhva_(rwhva) { DCHECK(rwhva_); aura::Window* root_window = rwhva_->window_->GetRootWindow(); DCHECK(root_window); root_window->AddPreTargetHandler(this); } virtual ~EventFilterForPopupExit() { aura::Window* root_window = rwhva_->window_->GetRootWindow(); DCHECK(root_window); root_window->RemovePreTargetHandler(this); } // Overridden from ui::EventHandler virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE { rwhva_->ApplyEventFilterForPopupExit(event); } private: RenderWidgetHostViewAura* rwhva_; DISALLOW_COPY_AND_ASSIGN(EventFilterForPopupExit); }; void RenderWidgetHostViewAura::ApplyEventFilterForPopupExit( ui::MouseEvent* event) { if (in_shutdown_ || is_fullscreen_) return; if (event->type() != ui::ET_MOUSE_PRESSED || !event->target()) return; aura::Window* target = static_cast<aura::Window*>(event->target()); if (target != window_ && (!popup_parent_host_view_ || target != popup_parent_host_view_->window_)) { // Note: popup_parent_host_view_ may be NULL when there are multiple // popup children per view. See: RenderWidgetHostViewAura::InitAsPopup(). in_shutdown_ = true; host_->Shutdown(); } } // We have to implement the WindowObserver interface on a separate object // because clang doesn't like implementing multiple interfaces that have // methods with the same name. This object is owned by the // RenderWidgetHostViewAura. class RenderWidgetHostViewAura::WindowObserver : public aura::WindowObserver { public: explicit WindowObserver(RenderWidgetHostViewAura* view) : view_(view) { view_->window_->AddObserver(this); } virtual ~WindowObserver() { view_->window_->RemoveObserver(this); } // Overridden from aura::WindowObserver: virtual void OnWindowAddedToRootWindow(aura::Window* window) OVERRIDE { if (window == view_->window_) view_->AddedToRootWindow(); } virtual void OnWindowRemovingFromRootWindow(aura::Window* window) OVERRIDE { if (window == view_->window_) view_->RemovingFromRootWindow(); } private: RenderWidgetHostViewAura* view_; DISALLOW_COPY_AND_ASSIGN(WindowObserver); }; //////////////////////////////////////////////////////////////////////////////// // RenderWidgetHostViewAura, public: RenderWidgetHostViewAura::RenderWidgetHostViewAura(RenderWidgetHost* host) : host_(RenderWidgetHostImpl::From(host)), window_(new aura::Window(this)), in_shutdown_(false), is_fullscreen_(false), popup_parent_host_view_(NULL), popup_child_host_view_(NULL), is_loading_(false), text_input_type_(ui::TEXT_INPUT_TYPE_NONE), text_input_mode_(ui::TEXT_INPUT_MODE_DEFAULT), can_compose_inline_(true), has_composition_text_(false), accept_return_character_(false), last_output_surface_id_(0), pending_delegated_ack_count_(0), skipped_frames_(false), last_swapped_surface_scale_factor_(1.f), paint_canvas_(NULL), synthetic_move_sent_(false), accelerated_compositing_state_changed_(false), can_lock_compositor_(YES), cursor_visibility_state_in_renderer_(UNKNOWN), paint_observer_(NULL), touch_editing_client_(NULL), delegated_frame_evictor_(new DelegatedFrameEvictor(this)), weak_ptr_factory_(this) { host_->SetView(this); window_observer_.reset(new WindowObserver(this)); aura::client::SetTooltipText(window_, &tooltip_); aura::client::SetActivationDelegate(window_, this); aura::client::SetActivationChangeObserver(window_, this); aura::client::SetFocusChangeObserver(window_, this); gfx::Screen::GetScreenFor(window_)->AddObserver(this); software_frame_manager_.reset(new SoftwareFrameManager( weak_ptr_factory_.GetWeakPtr())); #if defined(OS_WIN) plugin_parent_window_ = NULL; #endif } //////////////////////////////////////////////////////////////////////////////// // RenderWidgetHostViewAura, RenderWidgetHostView implementation: void RenderWidgetHostViewAura::InitAsChild( gfx::NativeView parent_view) { window_->Init(ui::LAYER_TEXTURED); window_->SetName("RenderWidgetHostViewAura"); } void RenderWidgetHostViewAura::InitAsPopup( RenderWidgetHostView* parent_host_view, const gfx::Rect& bounds_in_screen) { popup_parent_host_view_ = static_cast<RenderWidgetHostViewAura*>(parent_host_view); RenderWidgetHostViewAura* old_child = popup_parent_host_view_->popup_child_host_view_; if (old_child) { // TODO(jhorwich): Allow multiple popup_child_host_view_ per view, or // similar mechanism to ensure a second popup doesn't cause the first one // to never get a chance to filter events. See crbug.com/160589. DCHECK(old_child->popup_parent_host_view_ == popup_parent_host_view_); old_child->popup_parent_host_view_ = NULL; } popup_parent_host_view_->popup_child_host_view_ = this; window_->SetType(aura::client::WINDOW_TYPE_MENU); window_->Init(ui::LAYER_TEXTURED); window_->SetName("RenderWidgetHostViewAura"); aura::Window* root = popup_parent_host_view_->window_->GetRootWindow(); aura::client::ParentWindowWithContext(window_, root, bounds_in_screen); SetBounds(bounds_in_screen); Show(); } void RenderWidgetHostViewAura::InitAsFullscreen( RenderWidgetHostView* reference_host_view) { is_fullscreen_ = true; window_->SetType(aura::client::WINDOW_TYPE_NORMAL); window_->Init(ui::LAYER_TEXTURED); window_->SetName("RenderWidgetHostViewAura"); window_->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); aura::Window* parent = NULL; gfx::Rect bounds; if (reference_host_view) { aura::Window* reference_window = static_cast<RenderWidgetHostViewAura*>(reference_host_view)->window_; if (reference_window) { host_tracker_.reset(new aura::WindowTracker); host_tracker_->Add(reference_window); } gfx::Display display = gfx::Screen::GetScreenFor(window_)-> GetDisplayNearestWindow(reference_window); parent = reference_window->GetRootWindow(); bounds = display.bounds(); } aura::client::ParentWindowWithContext(window_, parent, bounds); Show(); Focus(); } RenderWidgetHost* RenderWidgetHostViewAura::GetRenderWidgetHost() const { return host_; } void RenderWidgetHostViewAura::WasShown() { DCHECK(host_); if (!host_->is_hidden()) return; host_->WasShown(); software_frame_manager_->SetVisibility(true); delegated_frame_evictor_->SetVisible(true); aura::Window* root = window_->GetRootWindow(); if (root) { aura::client::CursorClient* cursor_client = aura::client::GetCursorClient(root); if (cursor_client) NotifyRendererOfCursorVisibilityState(cursor_client->IsCursorVisible()); } if (!current_surface_.get() && host_->is_accelerated_compositing_active() && !released_front_lock_.get()) { ui::Compositor* compositor = GetCompositor(); if (compositor) released_front_lock_ = compositor->GetCompositorLock(); } #if defined(OS_WIN) LPARAM lparam = reinterpret_cast<LPARAM>(this); EnumChildWindows(ui::GetHiddenWindow(), ShowWindowsCallback, lparam); if (::IsWindow(plugin_parent_window_)) { gfx::Rect window_bounds = window_->GetBoundsInRootWindow(); ::SetWindowPos(plugin_parent_window_, NULL, window_bounds.x(), window_bounds.y(), window_bounds.width(), window_bounds.height(), 0); } #endif } void RenderWidgetHostViewAura::WasHidden() { if (!host_ || host_->is_hidden()) return; host_->WasHidden(); software_frame_manager_->SetVisibility(false); delegated_frame_evictor_->SetVisible(false); released_front_lock_ = NULL; #if defined(OS_WIN) constrained_rects_.clear(); aura::WindowEventDispatcher* dispatcher = window_->GetDispatcher(); if (dispatcher) { HWND parent = dispatcher->GetAcceleratedWidget(); LPARAM lparam = reinterpret_cast<LPARAM>(this); EnumChildWindows(parent, HideWindowsCallback, lparam); } if (::IsWindow(plugin_parent_window_)) ::SetWindowPos(plugin_parent_window_, NULL, 0, 0, 0, 0, 0); #endif } void RenderWidgetHostViewAura::SetSize(const gfx::Size& size) { // For a SetSize operation, we don't care what coordinate system the origin // of the window is in, it's only important to make sure that the origin // remains constant after the operation. InternalSetBounds(gfx::Rect(window_->bounds().origin(), size)); } void RenderWidgetHostViewAura::SetBounds(const gfx::Rect& rect) { gfx::Point relative_origin(rect.origin()); // RenderWidgetHostViewAura::SetBounds() takes screen coordinates, but // Window::SetBounds() takes parent coordinates, so do the conversion here. aura::Window* root = window_->GetRootWindow(); if (root) { aura::client::ScreenPositionClient* screen_position_client = aura::client::GetScreenPositionClient(root); if (screen_position_client) { screen_position_client->ConvertPointFromScreen( window_->parent(), &relative_origin); } } InternalSetBounds(gfx::Rect(relative_origin, rect.size())); } void RenderWidgetHostViewAura::MaybeCreateResizeLock() { if (!ShouldCreateResizeLock()) return; DCHECK(window_->GetDispatcher()); DCHECK(window_->GetDispatcher()->compositor()); // Listen to changes in the compositor lock state. ui::Compositor* compositor = window_->GetDispatcher()->compositor(); if (!compositor->HasObserver(this)) compositor->AddObserver(this); bool defer_compositor_lock = can_lock_compositor_ == NO_PENDING_RENDERER_FRAME || can_lock_compositor_ == NO_PENDING_COMMIT; if (can_lock_compositor_ == YES) can_lock_compositor_ = YES_DID_LOCK; resize_lock_ = CreateResizeLock(defer_compositor_lock); } bool RenderWidgetHostViewAura::ShouldCreateResizeLock() { // On Windows while resizing, the the resize locks makes us mis-paint a white // vertical strip (including the non-client area) if the content composition // is lagging the UI composition. So here we disable the throttling so that // the UI bits can draw ahead of the content thereby reducing the amount of // whiteout. Because this causes the content to be drawn at wrong sizes while // resizing we compensate by blocking the UI thread in Compositor::Draw() by // issuing a FinishAllRendering() if we are resizing. #if defined (OS_WIN) return false; #endif if (resize_lock_) return false; if (host_->should_auto_resize()) return false; if (!host_->is_accelerated_compositing_active()) return false; gfx::Size desired_size = window_->bounds().size(); if (desired_size == current_frame_size_) return false; aura::WindowEventDispatcher* dispatcher = window_->GetDispatcher(); if (!dispatcher) return false; ui::Compositor* compositor = dispatcher->compositor(); if (!compositor) return false; return true; } scoped_ptr<ResizeLock> RenderWidgetHostViewAura::CreateResizeLock( bool defer_compositor_lock) { gfx::Size desired_size = window_->bounds().size(); return scoped_ptr<ResizeLock>(new CompositorResizeLock( window_->GetDispatcher(), desired_size, defer_compositor_lock, base::TimeDelta::FromMilliseconds(kResizeLockTimeoutMs))); } gfx::NativeView RenderWidgetHostViewAura::GetNativeView() const { return window_; } gfx::NativeViewId RenderWidgetHostViewAura::GetNativeViewId() const { #if defined(OS_WIN) aura::WindowEventDispatcher* dispatcher = window_->GetDispatcher(); if (dispatcher) return reinterpret_cast<gfx::NativeViewId>( dispatcher->GetAcceleratedWidget()); #endif return static_cast<gfx::NativeViewId>(NULL); } gfx::NativeViewAccessible RenderWidgetHostViewAura::GetNativeViewAccessible() { #if defined(OS_WIN) aura::WindowEventDispatcher* dispatcher = window_->GetDispatcher(); if (!dispatcher) return static_cast<gfx::NativeViewAccessible>(NULL); HWND hwnd = dispatcher->GetAcceleratedWidget(); BrowserAccessibilityManager* manager = GetOrCreateBrowserAccessibilityManager(); if (manager) return manager->GetRoot()->ToBrowserAccessibilityWin(); #endif NOTIMPLEMENTED(); return static_cast<gfx::NativeViewAccessible>(NULL); } BrowserAccessibilityManager* RenderWidgetHostViewAura::GetOrCreateBrowserAccessibilityManager() { BrowserAccessibilityManager* manager = GetBrowserAccessibilityManager(); if (manager) return manager; #if defined(OS_WIN) aura::WindowEventDispatcher* dispatcher = window_->GetDispatcher(); if (!dispatcher) return NULL; HWND hwnd = dispatcher->GetAcceleratedWidget(); // The accessible_parent may be NULL at this point. The WebContents will pass // it down to this instance (by way of the RenderViewHost and // RenderWidgetHost) when it is known. This instance will then set it on its // BrowserAccessibilityManager. gfx::NativeViewAccessible accessible_parent = host_->GetParentNativeViewAccessible(); manager = new BrowserAccessibilityManagerWin( hwnd, accessible_parent, BrowserAccessibilityManagerWin::GetEmptyDocument(), this); #else manager = BrowserAccessibilityManager::Create( BrowserAccessibilityManager::GetEmptyDocument(), this); #endif SetBrowserAccessibilityManager(manager); return manager; } void RenderWidgetHostViewAura::SetKeyboardFocus() { #if defined(OS_WIN) if (CanFocus()) { aura::WindowEventDispatcher* dispatcher = window_->GetDispatcher(); if (dispatcher) ::SetFocus(dispatcher->GetAcceleratedWidget()); } #endif } void RenderWidgetHostViewAura::MovePluginWindows( const gfx::Vector2d& scroll_offset, const std::vector<WebPluginGeometry>& plugin_window_moves) { #if defined(OS_WIN) // We need to clip the rectangle to the tab's viewport, otherwise we will draw // over the browser UI. if (!window_->GetRootWindow()) { DCHECK(plugin_window_moves.empty()); return; } HWND parent = window_->GetDispatcher()->GetAcceleratedWidget(); gfx::Rect view_bounds = window_->GetBoundsInRootWindow(); std::vector<WebPluginGeometry> moves = plugin_window_moves; gfx::Rect view_port(scroll_offset.x(), scroll_offset.y(), view_bounds.width(), view_bounds.height()); for (size_t i = 0; i < moves.size(); ++i) { gfx::Rect clip(moves[i].clip_rect); gfx::Vector2d view_port_offset( moves[i].window_rect.OffsetFromOrigin() + scroll_offset); clip.Offset(view_port_offset); clip.Intersect(view_port); clip.Offset(-view_port_offset); moves[i].clip_rect = clip; moves[i].window_rect.Offset(view_bounds.OffsetFromOrigin()); plugin_window_moves_[moves[i].window] = moves[i]; // constrained_rects_ are relative to the root window. We want to convert // them to be relative to the plugin window. for (size_t j = 0; j < constrained_rects_.size(); ++j) { gfx::Rect offset_cutout = constrained_rects_[j]; offset_cutout -= moves[i].window_rect.OffsetFromOrigin(); moves[i].cutout_rects.push_back(offset_cutout); } } MovePluginWindowsHelper(parent, moves); // Make sure each plugin window (or its wrapper if it exists) has a pointer to // |this|. for (size_t i = 0; i < moves.size(); ++i) { HWND window = moves[i].window; if (GetParent(window) != parent) { window = GetParent(window); DCHECK(GetParent(window) == parent); } if (!GetProp(window, kWidgetOwnerProperty)) SetProp(window, kWidgetOwnerProperty, this); } #endif // defined(OS_WIN) } void RenderWidgetHostViewAura::Focus() { // Make sure we have a FocusClient before attempting to Focus(). In some // situations we may not yet be in a valid Window hierarchy (such as reloading // after out of memory discarded the tab). aura::client::FocusClient* client = aura::client::GetFocusClient(window_); if (client) window_->Focus(); } void RenderWidgetHostViewAura::Blur() { window_->Blur(); } bool RenderWidgetHostViewAura::HasFocus() const { return window_->HasFocus(); } bool RenderWidgetHostViewAura::IsSurfaceAvailableForCopy() const { return CanCopyToBitmap() || !!host_->GetBackingStore(false); } void RenderWidgetHostViewAura::Show() { window_->Show(); WasShown(); } void RenderWidgetHostViewAura::Hide() { window_->Hide(); WasHidden(); } bool RenderWidgetHostViewAura::IsShowing() { return window_->IsVisible(); } gfx::Rect RenderWidgetHostViewAura::GetViewBounds() const { // This is the size that we want the renderer to produce. While we're waiting // for the correct frame (i.e. during a resize), don't change the size so that // we don't pipeline more resizes than we can handle. gfx::Rect bounds(window_->GetBoundsInScreen()); if (resize_lock_.get()) return gfx::Rect(bounds.origin(), resize_lock_->expected_size()); else return bounds; } void RenderWidgetHostViewAura::SetBackground(const SkBitmap& background) { RenderWidgetHostViewBase::SetBackground(background); host_->SetBackground(background); window_->layer()->SetFillsBoundsOpaquely(background.isOpaque()); } void RenderWidgetHostViewAura::UpdateCursor(const WebCursor& cursor) { current_cursor_ = cursor; const gfx::Display display = gfx::Screen::GetScreenFor(window_)-> GetDisplayNearestWindow(window_); current_cursor_.SetDisplayInfo(display); UpdateCursorIfOverSelf(); } void RenderWidgetHostViewAura::SetIsLoading(bool is_loading) { if (is_loading_ && !is_loading && paint_observer_) paint_observer_->OnPageLoadComplete(); is_loading_ = is_loading; UpdateCursorIfOverSelf(); } void RenderWidgetHostViewAura::TextInputTypeChanged( ui::TextInputType type, ui::TextInputMode input_mode, bool can_compose_inline) { if (text_input_type_ != type || text_input_mode_ != input_mode || can_compose_inline_ != can_compose_inline) { text_input_type_ = type; text_input_mode_ = input_mode; can_compose_inline_ = can_compose_inline; if (GetInputMethod()) GetInputMethod()->OnTextInputTypeChanged(this); if (touch_editing_client_) touch_editing_client_->OnTextInputTypeChanged(text_input_type_); } } void RenderWidgetHostViewAura::ImeCancelComposition() { if (GetInputMethod()) GetInputMethod()->CancelComposition(this); has_composition_text_ = false; } void RenderWidgetHostViewAura::ImeCompositionRangeChanged( const gfx::Range& range, const std::vector<gfx::Rect>& character_bounds) { composition_character_bounds_ = character_bounds; } void RenderWidgetHostViewAura::DidUpdateBackingStore( const gfx::Rect& scroll_rect, const gfx::Vector2d& scroll_delta, const std::vector<gfx::Rect>& copy_rects, const ui::LatencyInfo& latency_info) { if (accelerated_compositing_state_changed_) UpdateExternalTexture(); software_latency_info_.MergeWith(latency_info); // Use the state of the RenderWidgetHost and not the window as the two may // differ. In particular if the window is hidden but the renderer isn't and we // ignore the update and the window is made visible again the layer isn't // marked as dirty and we show the wrong thing. // We do this after UpdateExternalTexture() so that when we become visible // we're not drawing a stale texture. if (host_->is_hidden()) return; gfx::Rect clip_rect; if (paint_canvas_) { SkRect sk_clip_rect; if (paint_canvas_->sk_canvas()->getClipBounds(&sk_clip_rect)) clip_rect = gfx::ToEnclosingRect(gfx::SkRectToRectF(sk_clip_rect)); } if (!scroll_rect.IsEmpty()) SchedulePaintIfNotInClip(scroll_rect, clip_rect); #if defined(OS_WIN) aura::WindowEventDispatcher* dispatcher = window_->GetDispatcher(); #endif for (size_t i = 0; i < copy_rects.size(); ++i) { gfx::Rect rect = gfx::SubtractRects(copy_rects[i], scroll_rect); if (rect.IsEmpty()) continue; SchedulePaintIfNotInClip(rect, clip_rect); #if defined(OS_WIN) if (dispatcher) { // Send the invalid rect in screen coordinates. gfx::Rect screen_rect = GetViewBounds(); gfx::Rect invalid_screen_rect(rect); invalid_screen_rect.Offset(screen_rect.x(), screen_rect.y()); HWND hwnd = dispatcher->GetAcceleratedWidget(); PaintPluginWindowsHelper(hwnd, invalid_screen_rect); } #endif // defined(OS_WIN) } } void RenderWidgetHostViewAura::RenderProcessGone(base::TerminationStatus status, int error_code) { UpdateCursorIfOverSelf(); Destroy(); } void RenderWidgetHostViewAura::Destroy() { // Beware, this function is not called on all destruction paths. It will // implicitly end up calling ~RenderWidgetHostViewAura though, so all // destruction/cleanup code should happen there, not here. in_shutdown_ = true; delete window_; } void RenderWidgetHostViewAura::SetTooltipText(const string16& tooltip_text) { tooltip_ = tooltip_text; aura::Window* root_window = window_->GetRootWindow(); aura::client::TooltipClient* tooltip_client = aura::client::GetTooltipClient(root_window); if (tooltip_client) { tooltip_client->UpdateTooltip(window_); // Content tooltips should be visible indefinitely. tooltip_client->SetTooltipShownTimeout(window_, 0); } } void RenderWidgetHostViewAura::SelectionChanged(const string16& text, size_t offset, const gfx::Range& range) { RenderWidgetHostViewBase::SelectionChanged(text, offset, range); #if defined(USE_X11) && !defined(OS_CHROMEOS) if (text.empty() || range.is_empty()) return; // Set the CLIPBOARD_TYPE_SELECTION to the ui::Clipboard. ui::ScopedClipboardWriter clipboard_writer( ui::Clipboard::GetForCurrentThread(), ui::CLIPBOARD_TYPE_SELECTION); clipboard_writer.WriteText(text); #endif // defined(USE_X11) && !defined(OS_CHROMEOS) } void RenderWidgetHostViewAura::SelectionBoundsChanged( const ViewHostMsg_SelectionBounds_Params& params) { if (selection_anchor_rect_ == params.anchor_rect && selection_focus_rect_ == params.focus_rect) return; selection_anchor_rect_ = params.anchor_rect; selection_focus_rect_ = params.focus_rect; if (GetInputMethod()) GetInputMethod()->OnCaretBoundsChanged(this); if (touch_editing_client_) { touch_editing_client_->OnSelectionOrCursorChanged(selection_anchor_rect_, selection_focus_rect_); } } void RenderWidgetHostViewAura::ScrollOffsetChanged() { aura::Window* root = window_->GetRootWindow(); if (!root) return; aura::client::CursorClient* cursor_client = aura::client::GetCursorClient(root); if (cursor_client && !cursor_client->IsCursorVisible()) cursor_client->DisableMouseEvents(); } BackingStore* RenderWidgetHostViewAura::AllocBackingStore( const gfx::Size& size) { return new BackingStoreAura(host_, size); } void RenderWidgetHostViewAura::CopyFromCompositingSurface( const gfx::Rect& src_subrect, const gfx::Size& dst_size, const base::Callback<void(bool, const SkBitmap&)>& callback) { if (!CanCopyToBitmap()) { callback.Run(false, SkBitmap()); return; } const gfx::Size& dst_size_in_pixel = ConvertViewSizeToPixel(this, dst_size); scoped_ptr<cc::CopyOutputRequest> request = cc::CopyOutputRequest::CreateRequest(base::Bind( &RenderWidgetHostViewAura::CopyFromCompositingSurfaceHasResult, dst_size_in_pixel, callback)); gfx::Rect src_subrect_in_pixel = ConvertRectToPixel(current_device_scale_factor_, src_subrect); request->set_area(src_subrect_in_pixel); window_->layer()->RequestCopyOfOutput(request.Pass()); } void RenderWidgetHostViewAura::CopyFromCompositingSurfaceToVideoFrame( const gfx::Rect& src_subrect, const scoped_refptr<media::VideoFrame>& target, const base::Callback<void(bool)>& callback) { if (!CanCopyToVideoFrame()) { callback.Run(false); return; } scoped_ptr<cc::CopyOutputRequest> request = cc::CopyOutputRequest::CreateRequest(base::Bind( &RenderWidgetHostViewAura:: CopyFromCompositingSurfaceHasResultForVideo, AsWeakPtr(), // For caching the ReadbackYUVInterface on this class. target, callback)); gfx::Rect src_subrect_in_pixel = ConvertRectToPixel(current_device_scale_factor_, src_subrect); request->set_area(src_subrect_in_pixel); window_->layer()->RequestCopyOfOutput(request.Pass()); } bool RenderWidgetHostViewAura::CanCopyToBitmap() const { return GetCompositor() && window_->layer()->has_external_content(); } bool RenderWidgetHostViewAura::CanCopyToVideoFrame() const { return GetCompositor() && window_->layer()->has_external_content() && host_->is_accelerated_compositing_active(); } bool RenderWidgetHostViewAura::CanSubscribeFrame() const { return true; } void RenderWidgetHostViewAura::BeginFrameSubscription( scoped_ptr<RenderWidgetHostViewFrameSubscriber> subscriber) { frame_subscriber_ = subscriber.Pass(); } void RenderWidgetHostViewAura::EndFrameSubscription() { frame_subscriber_.reset(); } void RenderWidgetHostViewAura::OnAcceleratedCompositingStateChange() { // Delay processing the state change until we either get a software frame if // switching to software mode or receive a buffers swapped notification // if switching to accelerated mode. // Sometimes (e.g. on a page load) the renderer will spuriously disable then // re-enable accelerated compositing, causing us to flash. // TODO(piman): factor the enable/disable accelerated compositing message into // the UpdateRect/AcceleratedSurfaceBuffersSwapped messages so that we have // fewer inconsistent temporary states. accelerated_compositing_state_changed_ = true; } bool RenderWidgetHostViewAura::ShouldSkipFrame(gfx::Size size_in_dip) const { if (can_lock_compositor_ == NO_PENDING_RENDERER_FRAME || can_lock_compositor_ == NO_PENDING_COMMIT || !resize_lock_.get()) return false; return size_in_dip != resize_lock_->expected_size(); } void RenderWidgetHostViewAura::InternalSetBounds(const gfx::Rect& rect) { if (HasDisplayPropertyChanged(window_)) host_->InvalidateScreenInfo(); window_->SetBounds(rect); host_->WasResized(); MaybeCreateResizeLock(); if (touch_editing_client_) { touch_editing_client_->OnSelectionOrCursorChanged(selection_anchor_rect_, selection_focus_rect_); } #if defined(OS_WIN) // Create the dummy plugin parent window which will be passed as the // container window to windowless plugins. // Plugins like Flash assume the container window which is returned via the // NPNVnetscapeWindow property corresponds to the bounds of the webpage. // This is not true in Aura where we have only HWND which is the main Aura // window. If we return this window to plugins like Flash then it causes the // coordinate translations done by these plugins to break. if (!plugin_parent_window_ && GetNativeViewId()) { plugin_parent_window_ = ::CreateWindowEx( 0, L"Static", NULL, WS_CHILDWINDOW, 0, 0, 0, 0, reinterpret_cast<HWND>(GetNativeViewId()), NULL, NULL, NULL); if (::IsWindow(plugin_parent_window_)) ::SetProp(plugin_parent_window_, content::kPluginDummyParentProperty, reinterpret_cast<HANDLE>(true)); } if (::IsWindow(plugin_parent_window_)) { gfx::Rect window_bounds = window_->GetBoundsInRootWindow(); ::SetWindowPos(plugin_parent_window_, NULL, window_bounds.x(), window_bounds.y(), window_bounds.width(), window_bounds.height(), 0); } #endif } void RenderWidgetHostViewAura::CheckResizeLock() { if (!resize_lock_ || resize_lock_->expected_size() != current_frame_size_) return; // Since we got the size we were looking for, unlock the compositor. But delay // the release of the lock until we've kicked a frame with the new texture, to // avoid resizing the UI before we have a chance to draw a "good" frame. resize_lock_->UnlockCompositor(); ui::Compositor* compositor = GetCompositor(); if (compositor) { if (!compositor->HasObserver(this)) compositor->AddObserver(this); } } void RenderWidgetHostViewAura::UpdateExternalTexture() { // Delay processing accelerated compositing state change till here where we // act upon the state change. (Clear the external texture if switching to // software mode or set the external texture if going to accelerated mode). if (accelerated_compositing_state_changed_) accelerated_compositing_state_changed_ = false; bool is_compositing_active = host_->is_accelerated_compositing_active(); if (is_compositing_active && current_surface_.get()) { window_->layer()->SetExternalTexture(current_surface_.get()); current_frame_size_ = ConvertSizeToDIP( current_surface_->device_scale_factor(), current_surface_->size()); CheckResizeLock(); software_frame_manager_->DiscardCurrentFrame(); } else if (is_compositing_active && software_frame_manager_->HasCurrentFrame()) { cc::TextureMailbox mailbox; scoped_ptr<cc::SingleReleaseCallback> callback; software_frame_manager_->GetCurrentFrameMailbox(&mailbox, &callback); window_->layer()->SetTextureMailbox(mailbox, callback.Pass(), last_swapped_surface_scale_factor_); current_frame_size_ = ConvertSizeToDIP(last_swapped_surface_scale_factor_, mailbox.shared_memory_size()); CheckResizeLock(); } else { window_->layer()->SetShowPaintedContent(); resize_lock_.reset(); host_->WasResized(); software_frame_manager_->DiscardCurrentFrame(); } } bool RenderWidgetHostViewAura::SwapBuffersPrepare( const gfx::Rect& surface_rect, float surface_scale_factor, const gfx::Rect& damage_rect, const std::string& mailbox_name, const BufferPresentedCallback& ack_callback) { if (last_swapped_surface_size_ != surface_rect.size()) { // The surface could have shrunk since we skipped an update, in which // case we can expect a full update. DLOG_IF(ERROR, damage_rect != surface_rect) << "Expected full damage rect"; skipped_damage_.setEmpty(); last_swapped_surface_size_ = surface_rect.size(); last_swapped_surface_scale_factor_ = surface_scale_factor; } if (ShouldSkipFrame(ConvertSizeToDIP(surface_scale_factor, surface_rect.size())) || mailbox_name.empty()) { skipped_damage_.op(RectToSkIRect(damage_rect), SkRegion::kUnion_Op); ack_callback.Run(true, scoped_refptr<ui::Texture>()); return false; } ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); current_surface_ = factory->CreateTransportClient(surface_scale_factor); if (!current_surface_.get()) { LOG(ERROR) << "Failed to create ImageTransport texture"; ack_callback.Run(true, scoped_refptr<ui::Texture>()); return false; } current_surface_->Consume(mailbox_name, surface_rect.size()); released_front_lock_ = NULL; UpdateExternalTexture(); return true; } void RenderWidgetHostViewAura::SwapBuffersCompleted( const BufferPresentedCallback& ack_callback, const scoped_refptr<ui::Texture>& texture_to_return) { ui::Compositor* compositor = GetCompositor(); if (!compositor) { ack_callback.Run(false, texture_to_return); } else { AddOnCommitCallbackAndDisableLocks( base::Bind(ack_callback, false, texture_to_return)); } DidReceiveFrameFromRenderer(); } void RenderWidgetHostViewAura::DidReceiveFrameFromRenderer() { if (frame_subscriber() && CanCopyToVideoFrame()) { const base::Time present_time = base::Time::Now(); scoped_refptr<media::VideoFrame> frame; RenderWidgetHostViewFrameSubscriber::DeliverFrameCallback callback; if (frame_subscriber()->ShouldCaptureFrame(present_time, &frame, &callback)) { CopyFromCompositingSurfaceToVideoFrame( gfx::Rect(current_frame_size_), frame, base::Bind(callback, present_time)); } } } #if defined(OS_WIN) void RenderWidgetHostViewAura::UpdateConstrainedWindowRects( const std::vector<gfx::Rect>& rects) { if (rects == constrained_rects_) return; constrained_rects_ = rects; UpdateCutoutRects(); } void RenderWidgetHostViewAura::UpdateCutoutRects() { if (!window_->GetRootWindow()) return; HWND parent = window_->GetDispatcher()->GetAcceleratedWidget(); CutoutRectsParams params; params.widget = this; params.cutout_rects = constrained_rects_; params.geometry = &plugin_window_moves_; LPARAM lparam = reinterpret_cast<LPARAM>(&params); EnumChildWindows(parent, SetCutoutRectsCallback, lparam); } #endif void RenderWidgetHostViewAura::AcceleratedSurfaceBuffersSwapped( const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params_in_pixel, int gpu_host_id) { BufferPresentedCallback ack_callback = base::Bind( &AcknowledgeBufferForGpu, params_in_pixel.route_id, gpu_host_id, params_in_pixel.mailbox_name); BuffersSwapped(params_in_pixel.size, gfx::Rect(params_in_pixel.size), params_in_pixel.scale_factor, params_in_pixel.mailbox_name, params_in_pixel.latency_info, ack_callback); } void RenderWidgetHostViewAura::SwapDelegatedFrame( uint32 output_surface_id, scoped_ptr<cc::DelegatedFrameData> frame_data, float frame_device_scale_factor, const ui::LatencyInfo& latency_info) { DCHECK_NE(0u, frame_data->render_pass_list.size()); cc::RenderPass* root_pass = frame_data->render_pass_list.back(); gfx::Size frame_size = root_pass->output_rect.size(); gfx::Size frame_size_in_dip = ConvertSizeToDIP(frame_device_scale_factor, frame_size); gfx::Rect damage_rect = gfx::ToEnclosingRect(root_pass->damage_rect); damage_rect.Intersect(gfx::Rect(frame_size)); gfx::Rect damage_rect_in_dip = ConvertRectToDIP(frame_device_scale_factor, damage_rect); software_frame_manager_->DiscardCurrentFrame(); if (ShouldSkipFrame(frame_size_in_dip)) { cc::CompositorFrameAck ack; cc::TransferableResource::ReturnResources(frame_data->resource_list, &ack.resources); RenderWidgetHostImpl::SendSwapCompositorFrameAck( host_->GetRoutingID(), output_surface_id, host_->GetProcess()->GetID(), ack); skipped_frames_ = true; return; } if (skipped_frames_) { skipped_frames_ = false; damage_rect = gfx::Rect(frame_size); damage_rect_in_dip = gfx::Rect(frame_size_in_dip); // Give the same damage rect to the compositor. cc::RenderPass* root_pass = frame_data->render_pass_list.back(); root_pass->damage_rect = damage_rect; } if (output_surface_id != last_output_surface_id_) { // Resource ids are scoped by the output surface. // If the originating output surface doesn't match the last one, it // indicates the renderer's output surface may have been recreated, in which // case we should recreate the DelegatedRendererLayer, to avoid matching // resources from the old one with resources from the new one which would // have the same id. Changing the layer to showing painted content destroys // the DelegatedRendererLayer. EvictDelegatedFrame(); // Drop the cc::DelegatedFrameResourceCollection so that we will not return // any resources from the old output surface with the new output surface id. if (resource_collection_.get()) { resource_collection_->SetClient(NULL); if (resource_collection_->LoseAllResources()) SendReturnedDelegatedResources(last_output_surface_id_); resource_collection_ = NULL; } last_output_surface_id_ = output_surface_id; } if (frame_size.IsEmpty()) { DCHECK_EQ(0u, frame_data->resource_list.size()); EvictDelegatedFrame(); } else { if (!resource_collection_) { resource_collection_ = new cc::DelegatedFrameResourceCollection; resource_collection_->SetClient(this); } if (!frame_provider_.get() || frame_size != frame_provider_->frame_size()) { frame_provider_ = new cc::DelegatedFrameProvider( resource_collection_.get(), frame_data.Pass()); window_->layer()->SetShowDelegatedContent(frame_provider_.get(), frame_size_in_dip); } else { frame_provider_->SetFrameData(frame_data.Pass()); } } released_front_lock_ = NULL; current_frame_size_ = frame_size_in_dip; CheckResizeLock(); if (paint_observer_) paint_observer_->OnUpdateCompositorContent(); window_->SchedulePaintInRect(damage_rect_in_dip); pending_delegated_ack_count_++; ui::Compositor* compositor = GetCompositor(); if (!compositor) { SendDelegatedFrameAck(output_surface_id); } else { compositor->SetLatencyInfo(latency_info); AddOnCommitCallbackAndDisableLocks( base::Bind(&RenderWidgetHostViewAura::SendDelegatedFrameAck, AsWeakPtr(), output_surface_id)); } DidReceiveFrameFromRenderer(); if (frame_provider_.get()) delegated_frame_evictor_->SwappedFrame(!host_->is_hidden()); // Note: the frame may have been evicted immediately. } void RenderWidgetHostViewAura::SendDelegatedFrameAck(uint32 output_surface_id) { cc::CompositorFrameAck ack; if (resource_collection_) resource_collection_->TakeUnusedResourcesForChildCompositor(&ack.resources); RenderWidgetHostImpl::SendSwapCompositorFrameAck(host_->GetRoutingID(), output_surface_id, host_->GetProcess()->GetID(), ack); DCHECK_GT(pending_delegated_ack_count_, 0); pending_delegated_ack_count_--; } void RenderWidgetHostViewAura::UnusedResourcesAreAvailable() { if (pending_delegated_ack_count_) return; SendReturnedDelegatedResources(last_output_surface_id_); } void RenderWidgetHostViewAura::SendReturnedDelegatedResources( uint32 output_surface_id) { cc::CompositorFrameAck ack; if (resource_collection_) resource_collection_->TakeUnusedResourcesForChildCompositor(&ack.resources); DCHECK(!ack.resources.empty()); RenderWidgetHostImpl::SendReclaimCompositorResources( host_->GetRoutingID(), output_surface_id, host_->GetProcess()->GetID(), ack); } void RenderWidgetHostViewAura::EvictDelegatedFrame() { window_->layer()->SetShowPaintedContent(); frame_provider_ = NULL; delegated_frame_evictor_->DiscardedFrame(); } void RenderWidgetHostViewAura::SwapSoftwareFrame( uint32 output_surface_id, scoped_ptr<cc::SoftwareFrameData> frame_data, float frame_device_scale_factor, const ui::LatencyInfo& latency_info) { const gfx::Size& frame_size = frame_data->size; const gfx::Rect& damage_rect = frame_data->damage_rect; gfx::Size frame_size_in_dip = ConvertSizeToDIP(frame_device_scale_factor, frame_size); if (ShouldSkipFrame(frame_size_in_dip)) { ReleaseSoftwareFrame(output_surface_id, frame_data->id); SendSoftwareFrameAck(output_surface_id); return; } if (!software_frame_manager_->SwapToNewFrame( output_surface_id, frame_data.get(), frame_device_scale_factor, host_->GetProcess()->GetHandle())) { ReleaseSoftwareFrame(output_surface_id, frame_data->id); SendSoftwareFrameAck(output_surface_id); return; } if (last_swapped_surface_size_ != frame_size) { DLOG_IF(ERROR, damage_rect != gfx::Rect(frame_size)) << "Expected full damage rect"; } last_swapped_surface_size_ = frame_size; last_swapped_surface_scale_factor_ = frame_device_scale_factor; cc::TextureMailbox mailbox; scoped_ptr<cc::SingleReleaseCallback> callback; software_frame_manager_->GetCurrentFrameMailbox(&mailbox, &callback); DCHECK(mailbox.IsSharedMemory()); current_frame_size_ = frame_size_in_dip; released_front_lock_ = NULL; CheckResizeLock(); window_->layer()->SetTextureMailbox(mailbox, callback.Pass(), frame_device_scale_factor); window_->SchedulePaintInRect( ConvertRectToDIP(frame_device_scale_factor, damage_rect)); ui::Compositor* compositor = GetCompositor(); if (compositor) { compositor->SetLatencyInfo(latency_info); AddOnCommitCallbackAndDisableLocks( base::Bind(&RenderWidgetHostViewAura::SendSoftwareFrameAck, AsWeakPtr(), output_surface_id)); } if (paint_observer_) paint_observer_->OnUpdateCompositorContent(); DidReceiveFrameFromRenderer(); software_frame_manager_->SwapToNewFrameComplete(!host_->is_hidden()); } void RenderWidgetHostViewAura::SendSoftwareFrameAck(uint32 output_surface_id) { unsigned software_frame_id = 0; if (released_software_frame_ && released_software_frame_->output_surface_id == output_surface_id) { software_frame_id = released_software_frame_->frame_id; released_software_frame_.reset(); } cc::CompositorFrameAck ack; ack.last_software_frame_id = software_frame_id; RenderWidgetHostImpl::SendSwapCompositorFrameAck( host_->GetRoutingID(), output_surface_id, host_->GetProcess()->GetID(), ack); SendReclaimSoftwareFrames(); } void RenderWidgetHostViewAura::SendReclaimSoftwareFrames() { if (!released_software_frame_) return; cc::CompositorFrameAck ack; ack.last_software_frame_id = released_software_frame_->frame_id; RenderWidgetHostImpl::SendReclaimCompositorResources( host_->GetRoutingID(), released_software_frame_->output_surface_id, host_->GetProcess()->GetID(), ack); released_software_frame_.reset(); } void RenderWidgetHostViewAura::ReleaseSoftwareFrame( uint32 output_surface_id, unsigned software_frame_id) { SendReclaimSoftwareFrames(); DCHECK(!released_software_frame_); released_software_frame_.reset(new ReleasedFrameInfo( output_surface_id, software_frame_id)); } void RenderWidgetHostViewAura::OnSwapCompositorFrame( uint32 output_surface_id, scoped_ptr<cc::CompositorFrame> frame) { TRACE_EVENT0("content", "RenderWidgetHostViewAura::OnSwapCompositorFrame"); if (frame->delegated_frame_data) { SwapDelegatedFrame(output_surface_id, frame->delegated_frame_data.Pass(), frame->metadata.device_scale_factor, frame->metadata.latency_info); return; } if (frame->software_frame_data) { SwapSoftwareFrame(output_surface_id, frame->software_frame_data.Pass(), frame->metadata.device_scale_factor, frame->metadata.latency_info); return; } if (!frame->gl_frame_data || frame->gl_frame_data->mailbox.IsZero()) return; BufferPresentedCallback ack_callback = base::Bind( &SendCompositorFrameAck, host_->GetRoutingID(), output_surface_id, host_->GetProcess()->GetID(), frame->gl_frame_data->mailbox, frame->gl_frame_data->size); if (!frame->gl_frame_data->sync_point) { LOG(ERROR) << "CompositorFrame without sync point. Skipping frame..."; ack_callback.Run(true, scoped_refptr<ui::Texture>()); return; } ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); factory->WaitSyncPoint(frame->gl_frame_data->sync_point); std::string mailbox_name( reinterpret_cast<const char*>(frame->gl_frame_data->mailbox.name), sizeof(frame->gl_frame_data->mailbox.name)); BuffersSwapped(frame->gl_frame_data->size, frame->gl_frame_data->sub_buffer_rect, frame->metadata.device_scale_factor, mailbox_name, frame->metadata.latency_info, ack_callback); } #if defined(OS_WIN) void RenderWidgetHostViewAura::SetParentNativeViewAccessible( gfx::NativeViewAccessible accessible_parent) { if (GetBrowserAccessibilityManager()) { GetBrowserAccessibilityManager()->ToBrowserAccessibilityManagerWin() ->set_parent_iaccessible(accessible_parent); } } gfx::NativeViewId RenderWidgetHostViewAura::GetParentForWindowlessPlugin() const { return reinterpret_cast<gfx::NativeViewId>(plugin_parent_window_); } #endif void RenderWidgetHostViewAura::BuffersSwapped( const gfx::Size& surface_size, const gfx::Rect& damage_rect, float surface_scale_factor, const std::string& mailbox_name, const ui::LatencyInfo& latency_info, const BufferPresentedCallback& ack_callback) { scoped_refptr<ui::Texture> previous_texture(current_surface_); const gfx::Rect surface_rect = gfx::Rect(surface_size); software_frame_manager_->DiscardCurrentFrame(); if (!SwapBuffersPrepare(surface_rect, surface_scale_factor, damage_rect, mailbox_name, ack_callback)) { return; } SkRegion damage(RectToSkIRect(damage_rect)); if (!skipped_damage_.isEmpty()) { damage.op(skipped_damage_, SkRegion::kUnion_Op); skipped_damage_.setEmpty(); } DCHECK(surface_rect.Contains(SkIRectToRect(damage.getBounds()))); ui::Texture* current_texture = current_surface_.get(); const gfx::Size surface_size_in_pixel = surface_size; DLOG_IF(ERROR, previous_texture.get() && previous_texture->size() != current_texture->size() && SkIRectToRect(damage.getBounds()) != surface_rect) << "Expected full damage rect after size change"; if (previous_texture.get() && !previous_damage_.isEmpty() && previous_texture->size() == current_texture->size()) { ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); GLHelper* gl_helper = factory->GetGLHelper(); gl_helper->CopySubBufferDamage( current_texture->PrepareTexture(), previous_texture->PrepareTexture(), damage, previous_damage_); } previous_damage_ = damage; ui::Compositor* compositor = GetCompositor(); if (compositor) { // Co-ordinates come in OpenGL co-ordinate space. // We need to convert to layer space. gfx::Rect rect_to_paint = ConvertRectToDIP(surface_scale_factor, gfx::Rect(damage_rect.x(), surface_size_in_pixel.height() - damage_rect.y() - damage_rect.height(), damage_rect.width(), damage_rect.height())); // Damage may not have been DIP aligned, so inflate damage to compensate // for any round-off error. rect_to_paint.Inset(-1, -1); rect_to_paint.Intersect(window_->bounds()); if (paint_observer_) paint_observer_->OnUpdateCompositorContent(); window_->SchedulePaintInRect(rect_to_paint); compositor->SetLatencyInfo(latency_info); } SwapBuffersCompleted(ack_callback, previous_texture); } void RenderWidgetHostViewAura::AcceleratedSurfacePostSubBuffer( const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params_in_pixel, int gpu_host_id) { gfx::Rect damage_rect(params_in_pixel.x, params_in_pixel.y, params_in_pixel.width, params_in_pixel.height); BufferPresentedCallback ack_callback = base::Bind(&AcknowledgeBufferForGpu, params_in_pixel.route_id, gpu_host_id, params_in_pixel.mailbox_name); BuffersSwapped(params_in_pixel.surface_size, damage_rect, params_in_pixel.surface_scale_factor, params_in_pixel.mailbox_name, params_in_pixel.latency_info, ack_callback); } void RenderWidgetHostViewAura::AcceleratedSurfaceSuspend() { } void RenderWidgetHostViewAura::AcceleratedSurfaceRelease() { // This really tells us to release the frontbuffer. if (current_surface_.get()) { ui::Compositor* compositor = GetCompositor(); if (compositor) { // We need to wait for a commit to clear to guarantee that all we // will not issue any more GL referencing the previous surface. AddOnCommitCallbackAndDisableLocks( base::Bind(&RenderWidgetHostViewAura::SetSurfaceNotInUseByCompositor, AsWeakPtr(), current_surface_)); // Hold a ref so the texture will not // get deleted until after commit. } current_surface_ = NULL; UpdateExternalTexture(); } } bool RenderWidgetHostViewAura::HasAcceleratedSurface( const gfx::Size& desired_size) { // Aura doesn't use GetBackingStore for accelerated pages, so it doesn't // matter what is returned here as GetBackingStore is the only caller of this // method. TODO(jbates) implement this if other Aura code needs it. return false; } void RenderWidgetHostViewAura::SetSurfaceNotInUseByCompositor( scoped_refptr<ui::Texture>) { } // static void RenderWidgetHostViewAura::CopyFromCompositingSurfaceHasResult( const gfx::Size& dst_size_in_pixel, const base::Callback<void(bool, const SkBitmap&)>& callback, scoped_ptr<cc::CopyOutputResult> result) { if (result->IsEmpty() || result->size().IsEmpty()) { callback.Run(false, SkBitmap()); return; } if (result->HasTexture()) { PrepareTextureCopyOutputResult(dst_size_in_pixel, callback, result.Pass()); return; } DCHECK(result->HasBitmap()); PrepareBitmapCopyOutputResult(dst_size_in_pixel, callback, result.Pass()); } static void CopyFromCompositingSurfaceFinished( const base::Callback<void(bool, const SkBitmap&)>& callback, scoped_ptr<cc::SingleReleaseCallback> release_callback, scoped_ptr<SkBitmap> bitmap, scoped_ptr<SkAutoLockPixels> bitmap_pixels_lock, bool result) { bitmap_pixels_lock.reset(); release_callback->Run(0, false); callback.Run(result, *bitmap); } // static void RenderWidgetHostViewAura::PrepareTextureCopyOutputResult( const gfx::Size& dst_size_in_pixel, const base::Callback<void(bool, const SkBitmap&)>& callback, scoped_ptr<cc::CopyOutputResult> result) { base::ScopedClosureRunner scoped_callback_runner( base::Bind(callback, false, SkBitmap())); DCHECK(result->HasTexture()); if (!result->HasTexture()) return; scoped_ptr<SkBitmap> bitmap(new SkBitmap); bitmap->setConfig(SkBitmap::kARGB_8888_Config, dst_size_in_pixel.width(), dst_size_in_pixel.height(), 0, kOpaque_SkAlphaType); if (!bitmap->allocPixels()) return; ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); GLHelper* gl_helper = factory->GetGLHelper(); if (!gl_helper) return; scoped_ptr<SkAutoLockPixels> bitmap_pixels_lock( new SkAutoLockPixels(*bitmap)); uint8* pixels = static_cast<uint8*>(bitmap->getPixels()); cc::TextureMailbox texture_mailbox; scoped_ptr<cc::SingleReleaseCallback> release_callback; result->TakeTexture(&texture_mailbox, &release_callback); DCHECK(texture_mailbox.IsTexture()); if (!texture_mailbox.IsTexture()) return; ignore_result(scoped_callback_runner.Release()); gl_helper->CropScaleReadbackAndCleanMailbox( texture_mailbox.name(), texture_mailbox.sync_point(), result->size(), gfx::Rect(result->size()), dst_size_in_pixel, pixels, base::Bind(&CopyFromCompositingSurfaceFinished, callback, base::Passed(&release_callback), base::Passed(&bitmap), base::Passed(&bitmap_pixels_lock))); } // static void RenderWidgetHostViewAura::PrepareBitmapCopyOutputResult( const gfx::Size& dst_size_in_pixel, const base::Callback<void(bool, const SkBitmap&)>& callback, scoped_ptr<cc::CopyOutputResult> result) { DCHECK(result->HasBitmap()); base::ScopedClosureRunner scoped_callback_runner( base::Bind(callback, false, SkBitmap())); if (!result->HasBitmap()) return; scoped_ptr<SkBitmap> source = result->TakeBitmap(); DCHECK(source); if (!source) return; ignore_result(scoped_callback_runner.Release()); SkBitmap bitmap = skia::ImageOperations::Resize( *source, skia::ImageOperations::RESIZE_BEST, dst_size_in_pixel.width(), dst_size_in_pixel.height()); callback.Run(true, bitmap); } static void CopyFromCompositingSurfaceFinishedForVideo( const base::Callback<void(bool)>& callback, scoped_ptr<cc::SingleReleaseCallback> release_callback, bool result) { release_callback->Run(0, false); callback.Run(result); } // static void RenderWidgetHostViewAura::CopyFromCompositingSurfaceHasResultForVideo( base::WeakPtr<RenderWidgetHostViewAura> rwhva, scoped_refptr<media::VideoFrame> video_frame, const base::Callback<void(bool)>& callback, scoped_ptr<cc::CopyOutputResult> result) { base::ScopedClosureRunner scoped_callback_runner(base::Bind(callback, false)); if (!rwhva) return; if (result->IsEmpty()) return; if (result->size().IsEmpty()) return; // Compute the dest size we want after the letterboxing resize. Make the // coordinates and sizes even because we letterbox in YUV space // (see CopyRGBToVideoFrame). They need to be even for the UV samples to // line up correctly. // The video frame's coded_size() and the result's size() are both physical // pixels. gfx::Rect region_in_frame = media::ComputeLetterboxRegion(gfx::Rect(video_frame->coded_size()), result->size()); region_in_frame = gfx::Rect(region_in_frame.x() & ~1, region_in_frame.y() & ~1, region_in_frame.width() & ~1, region_in_frame.height() & ~1); if (region_in_frame.IsEmpty()) return; // We only handle texture readbacks for now. If the compositor is in software // mode, we could produce a software-backed VideoFrame here as well. if (!result->HasTexture()) { DCHECK(result->HasBitmap()); scoped_ptr<SkBitmap> bitmap = result->TakeBitmap(); // Scale the bitmap to the required size, if necessary. SkBitmap scaled_bitmap; if (result->size().width() != region_in_frame.width() || result->size().height() != region_in_frame.height()) { skia::ImageOperations::ResizeMethod method = skia::ImageOperations::RESIZE_GOOD; scaled_bitmap = skia::ImageOperations::Resize(*bitmap.get(), method, region_in_frame.width(), region_in_frame.height()); } else { scaled_bitmap = *bitmap.get(); } { SkAutoLockPixels scaled_bitmap_locker(scaled_bitmap); media::CopyRGBToVideoFrame( reinterpret_cast<uint8*>(scaled_bitmap.getPixels()), scaled_bitmap.rowBytes(), region_in_frame, video_frame.get()); } ignore_result(scoped_callback_runner.Release()); callback.Run(true); return; } ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); GLHelper* gl_helper = factory->GetGLHelper(); if (!gl_helper) return; cc::TextureMailbox texture_mailbox; scoped_ptr<cc::SingleReleaseCallback> release_callback; result->TakeTexture(&texture_mailbox, &release_callback); DCHECK(texture_mailbox.IsTexture()); if (!texture_mailbox.IsTexture()) return; gfx::Rect result_rect(result->size()); content::ReadbackYUVInterface* yuv_readback_pipeline = rwhva->yuv_readback_pipeline_.get(); if (yuv_readback_pipeline == NULL || yuv_readback_pipeline->scaler()->SrcSize() != result_rect.size() || yuv_readback_pipeline->scaler()->SrcSubrect() != result_rect || yuv_readback_pipeline->scaler()->DstSize() != region_in_frame.size()) { GLHelper::ScalerQuality quality = GLHelper::SCALER_QUALITY_FAST; std::string quality_switch = switches::kTabCaptureDownscaleQuality; // If we're scaling up, we can use the "best" quality. if (result_rect.size().width() < region_in_frame.size().width() && result_rect.size().height() < region_in_frame.size().height()) quality_switch = switches::kTabCaptureUpscaleQuality; std::string switch_value = CommandLine::ForCurrentProcess()->GetSwitchValueASCII(quality_switch); if (switch_value == "fast") quality = GLHelper::SCALER_QUALITY_FAST; else if (switch_value == "good") quality = GLHelper::SCALER_QUALITY_GOOD; else if (switch_value == "best") quality = GLHelper::SCALER_QUALITY_BEST; rwhva->yuv_readback_pipeline_.reset( gl_helper->CreateReadbackPipelineYUV(quality, result_rect.size(), result_rect, video_frame->coded_size(), region_in_frame, true, true)); yuv_readback_pipeline = rwhva->yuv_readback_pipeline_.get(); } ignore_result(scoped_callback_runner.Release()); base::Callback<void(bool result)> finished_callback = base::Bind( &CopyFromCompositingSurfaceFinishedForVideo, callback, base::Passed(&release_callback)); yuv_readback_pipeline->ReadbackYUV( texture_mailbox.name(), texture_mailbox.sync_point(), video_frame.get(), finished_callback); } void RenderWidgetHostViewAura::GetScreenInfo(WebScreenInfo* results) { GetScreenInfoForWindow(results, window_->GetRootWindow() ? window_ : NULL); } gfx::Rect RenderWidgetHostViewAura::GetBoundsInRootWindow() { #if defined(OS_WIN) // aura::Window::GetBoundsInScreen doesn't take non-client area into // account. RECT window_rect = {0}; aura::Window* top_level = window_->GetToplevelWindow(); aura::WindowEventDispatcher* dispatcher = top_level->GetDispatcher(); if (!dispatcher) return top_level->GetBoundsInScreen(); HWND hwnd = dispatcher->GetAcceleratedWidget(); ::GetWindowRect(hwnd, &window_rect); gfx::Rect rect(window_rect); // Maximized windows are outdented from the work area by the frame thickness // even though this "frame" is not painted. This confuses code (and people) // that think of a maximized window as corresponding exactly to the work area. // Correct for this by subtracting the frame thickness back off. if (::IsZoomed(hwnd)) { rect.Inset(GetSystemMetrics(SM_CXSIZEFRAME), GetSystemMetrics(SM_CYSIZEFRAME)); } return gfx::win::ScreenToDIPRect(rect); #else return window_->GetToplevelWindow()->GetBoundsInScreen(); #endif } void RenderWidgetHostViewAura::GestureEventAck(int gesture_event_type, InputEventAckState ack_result) { if (touch_editing_client_) touch_editing_client_->GestureEventAck(gesture_event_type); } void RenderWidgetHostViewAura::ProcessAckedTouchEvent( const TouchEventWithLatencyInfo& touch, InputEventAckState ack_result) { ScopedVector<ui::TouchEvent> events; if (!MakeUITouchEventsFromWebTouchEvents(touch, &events, SCREEN_COORDINATES)) return; aura::WindowEventDispatcher* dispatcher = window_->GetDispatcher(); // |dispatcher| is NULL during tests. if (!dispatcher) return; ui::EventResult result = (ack_result == INPUT_EVENT_ACK_STATE_CONSUMED) ? ui::ER_HANDLED : ui::ER_UNHANDLED; for (ScopedVector<ui::TouchEvent>::iterator iter = events.begin(), end = events.end(); iter != end; ++iter) { dispatcher->ProcessedTouchEvent((*iter), window_, result); } } SyntheticGesture* RenderWidgetHostViewAura::CreateSmoothScrollGesture( bool scroll_down, int pixels_to_scroll, int mouse_event_x, int mouse_event_y) { return new TouchSmoothScrollGestureAura(scroll_down, pixels_to_scroll, mouse_event_x, mouse_event_y, window_); } void RenderWidgetHostViewAura::SetHasHorizontalScrollbar( bool has_horizontal_scrollbar) { // Not needed. Mac-only. } void RenderWidgetHostViewAura::SetScrollOffsetPinning( bool is_pinned_to_left, bool is_pinned_to_right) { // Not needed. Mac-only. } void RenderWidgetHostViewAura::OnAccessibilityEvents( const std::vector<AccessibilityHostMsg_EventParams>& params) { BrowserAccessibilityManager* manager = GetOrCreateBrowserAccessibilityManager(); if (manager) manager->OnAccessibilityEvents(params); } gfx::GLSurfaceHandle RenderWidgetHostViewAura::GetCompositingSurface() { if (shared_surface_handle_.is_null()) { ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); shared_surface_handle_ = factory->CreateSharedSurfaceHandle(); if (!shared_surface_handle_.is_null()) factory->AddObserver(this); } return shared_surface_handle_; } bool RenderWidgetHostViewAura::LockMouse() { aura::WindowEventDispatcher* dispatcher = window_->GetDispatcher(); if (!dispatcher) return false; if (mouse_locked_) return true; mouse_locked_ = true; #if !defined(OS_WIN) window_->SetCapture(); #endif aura::client::CursorClient* cursor_client = aura::client::GetCursorClient(dispatcher); if (cursor_client) { cursor_client->HideCursor(); cursor_client->LockCursor(); } if (ShouldMoveToCenter()) { synthetic_move_sent_ = true; window_->MoveCursorTo(gfx::Rect(window_->bounds().size()).CenterPoint()); } if (aura::client::GetTooltipClient(dispatcher)) aura::client::GetTooltipClient(dispatcher)->SetTooltipsEnabled(false); dispatcher->ConfineCursorToWindow(); return true; } void RenderWidgetHostViewAura::UnlockMouse() { aura::WindowEventDispatcher* dispatcher = window_->GetDispatcher(); if (!mouse_locked_ || !dispatcher) return; mouse_locked_ = false; #if !defined(OS_WIN) window_->ReleaseCapture(); #endif window_->MoveCursorTo(unlocked_mouse_position_); aura::client::CursorClient* cursor_client = aura::client::GetCursorClient(dispatcher); if (cursor_client) { cursor_client->UnlockCursor(); cursor_client->ShowCursor(); } if (aura::client::GetTooltipClient(dispatcher)) aura::client::GetTooltipClient(dispatcher)->SetTooltipsEnabled(true); host_->LostMouseLock(); dispatcher->UnConfineCursor(); } //////////////////////////////////////////////////////////////////////////////// // RenderWidgetHostViewAura, ui::TextInputClient implementation: void RenderWidgetHostViewAura::SetCompositionText( const ui::CompositionText& composition) { if (!host_) return; // ui::CompositionUnderline should be identical to // WebKit::WebCompositionUnderline, so that we can do reinterpret_cast safely. COMPILE_ASSERT(sizeof(ui::CompositionUnderline) == sizeof(WebKit::WebCompositionUnderline), ui_CompositionUnderline__WebKit_WebCompositionUnderline_diff); // TODO(suzhe): convert both renderer_host and renderer to use // ui::CompositionText. const std::vector<WebKit::WebCompositionUnderline>& underlines = reinterpret_cast<const std::vector<WebKit::WebCompositionUnderline>&>( composition.underlines); // TODO(suzhe): due to a bug of webkit, we can't use selection range with // composition string. See: https://bugs.webkit.org/show_bug.cgi?id=37788 host_->ImeSetComposition(composition.text, underlines, composition.selection.end(), composition.selection.end()); has_composition_text_ = !composition.text.empty(); } void RenderWidgetHostViewAura::ConfirmCompositionText() { if (host_ && has_composition_text_) host_->ImeConfirmComposition(string16(), gfx::Range::InvalidRange(), false); has_composition_text_ = false; } void RenderWidgetHostViewAura::ClearCompositionText() { if (host_ && has_composition_text_) host_->ImeCancelComposition(); has_composition_text_ = false; } void RenderWidgetHostViewAura::InsertText(const string16& text) { DCHECK(text_input_type_ != ui::TEXT_INPUT_TYPE_NONE); if (host_) host_->ImeConfirmComposition(text, gfx::Range::InvalidRange(), false); has_composition_text_ = false; } void RenderWidgetHostViewAura::InsertChar(char16 ch, int flags) { if (popup_child_host_view_ && popup_child_host_view_->NeedsInputGrab()) { popup_child_host_view_->InsertChar(ch, flags); return; } // Ignore character messages for VKEY_RETURN sent on CTRL+M. crbug.com/315547 if (host_ && (accept_return_character_ || ch != ui::VKEY_RETURN)) { double now = ui::EventTimeForNow().InSecondsF(); // Send a WebKit::WebInputEvent::Char event to |host_|. NativeWebKeyboardEvent webkit_event(ui::ET_KEY_PRESSED, true /* is_char */, ch, flags, now); host_->ForwardKeyboardEvent(webkit_event); } } gfx::NativeWindow RenderWidgetHostViewAura::GetAttachedWindow() const { return window_; } ui::TextInputType RenderWidgetHostViewAura::GetTextInputType() const { return text_input_type_; } ui::TextInputMode RenderWidgetHostViewAura::GetTextInputMode() const { return text_input_mode_; } bool RenderWidgetHostViewAura::CanComposeInline() const { return can_compose_inline_; } gfx::Rect RenderWidgetHostViewAura::ConvertRectToScreen( const gfx::Rect& rect) const { gfx::Point origin = rect.origin(); gfx::Point end = gfx::Point(rect.right(), rect.bottom()); aura::Window* root_window = window_->GetRootWindow(); if (!root_window) return rect; aura::client::ScreenPositionClient* screen_position_client = aura::client::GetScreenPositionClient(root_window); if (!screen_position_client) return rect; screen_position_client->ConvertPointToScreen(window_, &origin); screen_position_client->ConvertPointToScreen(window_, &end); return gfx::Rect(origin.x(), origin.y(), end.x() - origin.x(), end.y() - origin.y()); } gfx::Rect RenderWidgetHostViewAura::ConvertRectFromScreen( const gfx::Rect& rect) const { gfx::Point origin = rect.origin(); gfx::Point end = gfx::Point(rect.right(), rect.bottom()); aura::Window* root_window = window_->GetRootWindow(); if (root_window) { aura::client::ScreenPositionClient* screen_position_client = aura::client::GetScreenPositionClient(root_window); screen_position_client->ConvertPointFromScreen(window_, &origin); screen_position_client->ConvertPointFromScreen(window_, &end); return gfx::Rect(origin.x(), origin.y(), end.x() - origin.x(), end.y() - origin.y()); } return rect; } gfx::Rect RenderWidgetHostViewAura::GetCaretBounds() const { const gfx::Rect rect = gfx::UnionRects(selection_anchor_rect_, selection_focus_rect_); return ConvertRectToScreen(rect); } bool RenderWidgetHostViewAura::GetCompositionCharacterBounds( uint32 index, gfx::Rect* rect) const { DCHECK(rect); if (index >= composition_character_bounds_.size()) return false; *rect = ConvertRectToScreen(composition_character_bounds_[index]); return true; } bool RenderWidgetHostViewAura::HasCompositionText() const { return has_composition_text_; } bool RenderWidgetHostViewAura::GetTextRange(gfx::Range* range) const { range->set_start(selection_text_offset_); range->set_end(selection_text_offset_ + selection_text_.length()); return true; } bool RenderWidgetHostViewAura::GetCompositionTextRange( gfx::Range* range) const { // TODO(suzhe): implement this method when fixing http://crbug.com/55130. NOTIMPLEMENTED(); return false; } bool RenderWidgetHostViewAura::GetSelectionRange(gfx::Range* range) const { range->set_start(selection_range_.start()); range->set_end(selection_range_.end()); return true; } bool RenderWidgetHostViewAura::SetSelectionRange(const gfx::Range& range) { // TODO(suzhe): implement this method when fixing http://crbug.com/55130. NOTIMPLEMENTED(); return false; } bool RenderWidgetHostViewAura::DeleteRange(const gfx::Range& range) { // TODO(suzhe): implement this method when fixing http://crbug.com/55130. NOTIMPLEMENTED(); return false; } bool RenderWidgetHostViewAura::GetTextFromRange( const gfx::Range& range, string16* text) const { gfx::Range selection_text_range(selection_text_offset_, selection_text_offset_ + selection_text_.length()); if (!selection_text_range.Contains(range)) { text->clear(); return false; } if (selection_text_range.EqualsIgnoringDirection(range)) { // Avoid calling substr whose performance is low. *text = selection_text_; } else { *text = selection_text_.substr( range.GetMin() - selection_text_offset_, range.length()); } return true; } void RenderWidgetHostViewAura::OnInputMethodChanged() { if (!host_) return; if (GetInputMethod()) host_->SetInputMethodActive(GetInputMethod()->IsActive()); // TODO(suzhe): implement the newly added “locale” property of HTML DOM // TextEvent. } bool RenderWidgetHostViewAura::ChangeTextDirectionAndLayoutAlignment( base::i18n::TextDirection direction) { if (!host_) return false; host_->UpdateTextDirection( direction == base::i18n::RIGHT_TO_LEFT ? WebKit::WebTextDirectionRightToLeft : WebKit::WebTextDirectionLeftToRight); host_->NotifyTextDirection(); return true; } void RenderWidgetHostViewAura::ExtendSelectionAndDelete( size_t before, size_t after) { if (host_) host_->ExtendSelectionAndDelete(before, after); } void RenderWidgetHostViewAura::EnsureCaretInRect(const gfx::Rect& rect) { gfx::Rect intersected_rect( gfx::IntersectRects(rect, window_->GetBoundsInScreen())); if (intersected_rect.IsEmpty()) return; host_->ScrollFocusedEditableNodeIntoRect( ConvertRectFromScreen(intersected_rect)); } //////////////////////////////////////////////////////////////////////////////// // RenderWidgetHostViewAura, gfx::DisplayObserver implementation: void RenderWidgetHostViewAura::OnDisplayBoundsChanged( const gfx::Display& display) { gfx::Screen* screen = gfx::Screen::GetScreenFor(window_); if (display.id() == screen->GetDisplayNearestWindow(window_).id()) { UpdateScreenInfo(window_); current_cursor_.SetDisplayInfo(display); UpdateCursorIfOverSelf(); } } void RenderWidgetHostViewAura::OnDisplayAdded( const gfx::Display& new_display) { } void RenderWidgetHostViewAura::OnDisplayRemoved( const gfx::Display& old_display) { } //////////////////////////////////////////////////////////////////////////////// // RenderWidgetHostViewAura, aura::WindowDelegate implementation: gfx::Size RenderWidgetHostViewAura::GetMinimumSize() const { return gfx::Size(); } gfx::Size RenderWidgetHostViewAura::GetMaximumSize() const { return gfx::Size(); } void RenderWidgetHostViewAura::OnBoundsChanged(const gfx::Rect& old_bounds, const gfx::Rect& new_bounds) { // We care about this only in fullscreen mode, where there is no // WebContentsViewAura. We are sized via SetSize() or SetBounds() by // WebContentsViewAura in other cases. if (is_fullscreen_) SetSize(new_bounds.size()); } gfx::NativeCursor RenderWidgetHostViewAura::GetCursor(const gfx::Point& point) { if (mouse_locked_) return ui::kCursorNone; return current_cursor_.GetNativeCursor(); } int RenderWidgetHostViewAura::GetNonClientComponent( const gfx::Point& point) const { return HTCLIENT; } bool RenderWidgetHostViewAura::ShouldDescendIntoChildForEventHandling( aura::Window* child, const gfx::Point& location) { return true; } bool RenderWidgetHostViewAura::CanFocus() { return popup_type_ == WebKit::WebPopupTypeNone; } void RenderWidgetHostViewAura::OnCaptureLost() { host_->LostCapture(); if (touch_editing_client_) touch_editing_client_->EndTouchEditing(); } void RenderWidgetHostViewAura::OnPaint(gfx::Canvas* canvas) { bool has_backing_store = !!host_->GetBackingStore(false); if (has_backing_store) { paint_canvas_ = canvas; BackingStoreAura* backing_store = static_cast<BackingStoreAura*>( host_->GetBackingStore(true)); paint_canvas_ = NULL; backing_store->SkiaShowRect(gfx::Point(), canvas); if (paint_observer_) paint_observer_->OnPaintComplete(); ui::Compositor* compositor = GetCompositor(); if (compositor) { compositor->SetLatencyInfo(software_latency_info_); software_latency_info_.Clear(); } } else { // For non-opaque windows, we don't draw anything, since we depend on the // canvas coming from the compositor to already be initialized as // transparent. if (window_->layer()->fills_bounds_opaquely()) canvas->DrawColor(SK_ColorWHITE); } } void RenderWidgetHostViewAura::OnDeviceScaleFactorChanged( float device_scale_factor) { if (!host_) return; BackingStoreAura* backing_store = static_cast<BackingStoreAura*>( host_->GetBackingStore(false)); if (backing_store) // NULL in hardware path. backing_store->ScaleFactorChanged(device_scale_factor); UpdateScreenInfo(window_); const gfx::Display display = gfx::Screen::GetScreenFor(window_)-> GetDisplayNearestWindow(window_); DCHECK_EQ(device_scale_factor, display.device_scale_factor()); current_cursor_.SetDisplayInfo(display); } void RenderWidgetHostViewAura::OnWindowDestroying() { #if defined(OS_WIN) HWND parent = NULL; // If the tab was hidden and it's closed, host_->is_hidden would have been // reset to false in RenderWidgetHostImpl::RendererExited. if (!window_->GetRootWindow() || host_->is_hidden()) { parent = ui::GetHiddenWindow(); } else { parent = window_->GetDispatcher()->GetAcceleratedWidget(); } LPARAM lparam = reinterpret_cast<LPARAM>(this); EnumChildWindows(parent, WindowDestroyingCallback, lparam); #endif // Make sure that the input method no longer references to this object before // this object is removed from the root window (i.e. this object loses access // to the input method). ui::InputMethod* input_method = GetInputMethod(); if (input_method) input_method->DetachTextInputClient(this); } void RenderWidgetHostViewAura::OnWindowDestroyed() { host_->ViewDestroyed(); delete this; } void RenderWidgetHostViewAura::OnWindowTargetVisibilityChanged(bool visible) { } bool RenderWidgetHostViewAura::HasHitTestMask() const { return false; } void RenderWidgetHostViewAura::GetHitTestMask(gfx::Path* mask) const { } void RenderWidgetHostViewAura::DidRecreateLayer(ui::Layer *old_layer, ui::Layer *new_layer) { float mailbox_scale_factor; cc::TextureMailbox old_mailbox = old_layer->GetTextureMailbox(&mailbox_scale_factor); scoped_refptr<ui::Texture> old_texture = old_layer->external_texture(); // The new_layer is the one that will be used by our Window, so that's the one // that should keep our texture. old_layer will be returned to the // RecreateLayer caller, and should have a copy. if (old_texture.get()) { ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); GLHelper* gl_helper = factory->GetGLHelper(); scoped_refptr<ui::Texture> new_texture; if (host_->is_accelerated_compositing_active() && gl_helper && current_surface_.get()) { WebKit::WebGLId texture_id = gl_helper->CopyTexture(current_surface_->PrepareTexture(), current_surface_->size()); if (texture_id) { new_texture = factory->CreateOwnedTexture( current_surface_->size(), current_surface_->device_scale_factor(), texture_id); } } if (new_texture.get()) old_layer->SetExternalTexture(new_texture.get()); else old_layer->SetShowPaintedContent(); new_layer->SetExternalTexture(old_texture.get()); } else if (old_mailbox.IsSharedMemory()) { base::SharedMemory* old_buffer = old_mailbox.shared_memory(); const size_t size = old_mailbox.shared_memory_size_in_bytes(); scoped_ptr<base::SharedMemory> new_buffer(new base::SharedMemory); new_buffer->CreateAndMapAnonymous(size); if (old_buffer->memory() && new_buffer->memory()) { memcpy(new_buffer->memory(), old_buffer->memory(), size); base::SharedMemory* new_buffer_raw_ptr = new_buffer.get(); scoped_ptr<cc::SingleReleaseCallback> callback = cc::SingleReleaseCallback::Create(base::Bind(MailboxReleaseCallback, Passed(&new_buffer))); cc::TextureMailbox new_mailbox(new_buffer_raw_ptr, old_mailbox.shared_memory_size()); new_layer->SetTextureMailbox(new_mailbox, callback.Pass(), mailbox_scale_factor); } } else if (frame_provider_.get()) { new_layer->SetShowDelegatedContent(frame_provider_.get(), current_frame_size_); } } //////////////////////////////////////////////////////////////////////////////// // RenderWidgetHostViewAura, ui::EventHandler implementation: void RenderWidgetHostViewAura::OnKeyEvent(ui::KeyEvent* event) { TRACE_EVENT0("input", "RenderWidgetHostViewAura::OnKeyEvent"); if (touch_editing_client_ && touch_editing_client_->HandleInputEvent(event)) return; if (popup_child_host_view_ && popup_child_host_view_->NeedsInputGrab()) { popup_child_host_view_->OnKeyEvent(event); if (event->handled()) return; } // We need to handle the Escape key for Pepper Flash. if (is_fullscreen_ && event->key_code() == ui::VKEY_ESCAPE) { // Focus the window we were created from. if (host_tracker_.get() && !host_tracker_->windows().empty()) { aura::Window* host = *(host_tracker_->windows().begin()); aura::client::FocusClient* client = aura::client::GetFocusClient(host); if (client) { // Calling host->Focus() may delete |this|. We create a local observer // for that. In that case we exit without further access to any members. aura::WindowTracker tracker; aura::Window* window = window_; tracker.Add(window); host->Focus(); if (!tracker.Contains(window)) { event->SetHandled(); return; } } } if (!in_shutdown_) { in_shutdown_ = true; host_->Shutdown(); } } else { if (event->key_code() == ui::VKEY_RETURN) { // Do not forward return key release events if no press event was handled. if (event->type() == ui::ET_KEY_RELEASED && !accept_return_character_) return; // Accept return key character events between press and release events. accept_return_character_ = event->type() == ui::ET_KEY_PRESSED; } // We don't have to communicate with an input method here. if (!event->HasNativeEvent()) { NativeWebKeyboardEvent webkit_event( event->type(), event->is_char(), event->is_char() ? event->GetCharacter() : event->key_code(), event->flags(), ui::EventTimeForNow().InSecondsF()); host_->ForwardKeyboardEvent(webkit_event); } else { NativeWebKeyboardEvent webkit_event(event); host_->ForwardKeyboardEvent(webkit_event); } } event->SetHandled(); } void RenderWidgetHostViewAura::OnMouseEvent(ui::MouseEvent* event) { TRACE_EVENT0("input", "RenderWidgetHostViewAura::OnMouseEvent"); if (touch_editing_client_ && touch_editing_client_->HandleInputEvent(event)) return; if (mouse_locked_) { aura::client::CursorClient* cursor_client = aura::client::GetCursorClient(window_->GetRootWindow()); DCHECK(!cursor_client || !cursor_client->IsCursorVisible()); if (event->type() == ui::ET_MOUSEWHEEL) { WebKit::WebMouseWheelEvent mouse_wheel_event = MakeWebMouseWheelEvent(static_cast<ui::MouseWheelEvent*>(event)); if (mouse_wheel_event.deltaX != 0 || mouse_wheel_event.deltaY != 0) host_->ForwardWheelEvent(mouse_wheel_event); return; } gfx::Point center(gfx::Rect(window_->bounds().size()).CenterPoint()); // If we receive non client mouse messages while we are in the locked state // it probably means that the mouse left the borders of our window and // needs to be moved back to the center. if (event->flags() & ui::EF_IS_NON_CLIENT) { synthetic_move_sent_ = true; window_->MoveCursorTo(center); return; } WebKit::WebMouseEvent mouse_event = MakeWebMouseEvent(event); bool is_move_to_center_event = (event->type() == ui::ET_MOUSE_MOVED || event->type() == ui::ET_MOUSE_DRAGGED) && mouse_event.x == center.x() && mouse_event.y == center.y(); ModifyEventMovementAndCoords(&mouse_event); bool should_not_forward = is_move_to_center_event && synthetic_move_sent_; if (should_not_forward) { synthetic_move_sent_ = false; } else { // Check if the mouse has reached the border and needs to be centered. if (ShouldMoveToCenter()) { synthetic_move_sent_ = true; window_->MoveCursorTo(center); } // Forward event to renderer. if (CanRendererHandleEvent(event) && !(event->flags() & ui::EF_FROM_TOUCH)) { host_->ForwardMouseEvent(mouse_event); // Ensure that we get keyboard focus on mouse down as a plugin window // may have grabbed keyboard focus. if (event->type() == ui::ET_MOUSE_PRESSED) SetKeyboardFocus(); } } return; } // As the overscroll is handled during scroll events from the trackpad, the // RWHVA window is transformed by the overscroll controller. This transform // triggers a synthetic mouse-move event to be generated (by the aura // RootWindow). But this event interferes with the overscroll gesture. So, // ignore such synthetic mouse-move events if an overscroll gesture is in // progress. if (host_->overscroll_controller() && host_->overscroll_controller()->overscroll_mode() != OVERSCROLL_NONE && event->flags() & ui::EF_IS_SYNTHESIZED && (event->type() == ui::ET_MOUSE_ENTERED || event->type() == ui::ET_MOUSE_EXITED || event->type() == ui::ET_MOUSE_MOVED)) { event->StopPropagation(); return; } if (event->type() == ui::ET_MOUSEWHEEL) { #if defined(OS_WIN) // We get mouse wheel/scroll messages even if we are not in the foreground. // So here we check if we have any owned popup windows in the foreground and // dismiss them. aura::WindowEventDispatcher* dispatcher = window_->GetDispatcher(); if (dispatcher) { HWND parent = dispatcher->GetAcceleratedWidget(); HWND toplevel_hwnd = ::GetAncestor(parent, GA_ROOT); EnumThreadWindows(GetCurrentThreadId(), DismissOwnedPopups, reinterpret_cast<LPARAM>(toplevel_hwnd)); } #endif WebKit::WebMouseWheelEvent mouse_wheel_event = MakeWebMouseWheelEvent(static_cast<ui::MouseWheelEvent*>(event)); if (mouse_wheel_event.deltaX != 0 || mouse_wheel_event.deltaY != 0) host_->ForwardWheelEvent(mouse_wheel_event); } else if (CanRendererHandleEvent(event) && !(event->flags() & ui::EF_FROM_TOUCH)) { WebKit::WebMouseEvent mouse_event = MakeWebMouseEvent(event); ModifyEventMovementAndCoords(&mouse_event); host_->ForwardMouseEvent(mouse_event); // Ensure that we get keyboard focus on mouse down as a plugin window may // have grabbed keyboard focus. if (event->type() == ui::ET_MOUSE_PRESSED) SetKeyboardFocus(); } switch (event->type()) { case ui::ET_MOUSE_PRESSED: window_->SetCapture(); // Confirm existing composition text on mouse click events, to make sure // the input caret won't be moved with an ongoing composition text. FinishImeCompositionSession(); break; case ui::ET_MOUSE_RELEASED: window_->ReleaseCapture(); break; default: break; } // Needed to propagate mouse event to native_tab_contents_view_aura. // TODO(pkotwicz): Find a better way of doing this. // In fullscreen mode which is typically used by flash, don't forward // the mouse events to the parent. The renderer and the plugin process // handle these events. if (!is_fullscreen_ && window_->parent()->delegate() && !(event->flags() & ui::EF_FROM_TOUCH)) window_->parent()->delegate()->OnMouseEvent(event); if (!IsXButtonUpEvent(event)) event->SetHandled(); } void RenderWidgetHostViewAura::OnScrollEvent(ui::ScrollEvent* event) { TRACE_EVENT0("input", "RenderWidgetHostViewAura::OnScrollEvent"); if (touch_editing_client_ && touch_editing_client_->HandleInputEvent(event)) return; if (event->type() == ui::ET_SCROLL) { #if !defined(OS_WIN) // TODO(ananta) // Investigate if this is true for Windows 8 Metro ASH as well. if (event->finger_count() != 2) return; #endif WebKit::WebGestureEvent gesture_event = MakeWebGestureEventFlingCancel(); host_->ForwardGestureEvent(gesture_event); WebKit::WebMouseWheelEvent mouse_wheel_event = MakeWebMouseWheelEvent(event); host_->ForwardWheelEvent(mouse_wheel_event); RecordAction(UserMetricsAction("TrackpadScroll")); } else if (event->type() == ui::ET_SCROLL_FLING_START || event->type() == ui::ET_SCROLL_FLING_CANCEL) { WebKit::WebGestureEvent gesture_event = MakeWebGestureEvent(event); host_->ForwardGestureEvent(gesture_event); if (event->type() == ui::ET_SCROLL_FLING_START) RecordAction(UserMetricsAction("TrackpadScrollFling")); } event->SetHandled(); } void RenderWidgetHostViewAura::OnTouchEvent(ui::TouchEvent* event) { TRACE_EVENT0("input", "RenderWidgetHostViewAura::OnTouchEvent"); if (touch_editing_client_ && touch_editing_client_->HandleInputEvent(event)) return; // Update the touch event first. WebKit::WebTouchPoint* point = UpdateWebTouchEventFromUIEvent(*event, &touch_event_); // Forward the touch event only if a touch point was updated, and there's a // touch-event handler in the page, and no other touch-event is in the queue. // It is important to always consume the event if there is a touch-event // handler in the page, or some touch-event is already in the queue, even if // no point has been updated, to make sure that this event does not get // processed by the gesture recognizer before the events in the queue. if (host_->ShouldForwardTouchEvent()) event->StopPropagation(); if (point) { if (host_->ShouldForwardTouchEvent()) host_->ForwardTouchEventWithLatencyInfo(touch_event_, *event->latency()); UpdateWebTouchEventAfterDispatch(&touch_event_, point); } } void RenderWidgetHostViewAura::OnGestureEvent(ui::GestureEvent* event) { TRACE_EVENT0("input", "RenderWidgetHostViewAura::OnGestureEvent"); // Pinch gestures are currently disabled by default. See crbug.com/128477. if ((event->type() == ui::ET_GESTURE_PINCH_BEGIN || event->type() == ui::ET_GESTURE_PINCH_UPDATE || event->type() == ui::ET_GESTURE_PINCH_END) && !ShouldSendPinchGesture()) { event->SetHandled(); return; } if (touch_editing_client_ && touch_editing_client_->HandleInputEvent(event)) return; RenderViewHostDelegate* delegate = NULL; if (popup_type_ == WebKit::WebPopupTypeNone && !is_fullscreen_) delegate = RenderViewHost::From(host_)->GetDelegate(); if (delegate && event->type() == ui::ET_GESTURE_BEGIN && event->details().touch_points() == 1) { delegate->HandleGestureBegin(); } WebKit::WebGestureEvent gesture = MakeWebGestureEvent(event); if (event->type() == ui::ET_GESTURE_TAP_DOWN) { // Webkit does not stop a fling-scroll on tap-down. So explicitly send an // event to stop any in-progress flings. WebKit::WebGestureEvent fling_cancel = gesture; fling_cancel.type = WebKit::WebInputEvent::GestureFlingCancel; fling_cancel.sourceDevice = WebKit::WebGestureEvent::Touchscreen; host_->ForwardGestureEvent(fling_cancel); } if (gesture.type != WebKit::WebInputEvent::Undefined) { host_->ForwardGestureEventWithLatencyInfo(gesture, *event->latency()); if (event->type() == ui::ET_GESTURE_SCROLL_BEGIN || event->type() == ui::ET_GESTURE_SCROLL_UPDATE || event->type() == ui::ET_GESTURE_SCROLL_END) { RecordAction(UserMetricsAction("TouchscreenScroll")); } else if (event->type() == ui::ET_SCROLL_FLING_START) { RecordAction(UserMetricsAction("TouchscreenScrollFling")); } } if (delegate && event->type() == ui::ET_GESTURE_END && event->details().touch_points() == 1) { delegate->HandleGestureEnd(); } // If a gesture is not processed by the webpage, then WebKit processes it // (e.g. generates synthetic mouse events). event->SetHandled(); } //////////////////////////////////////////////////////////////////////////////// // RenderWidgetHostViewAura, aura::client::ActivationDelegate implementation: bool RenderWidgetHostViewAura::ShouldActivate() const { aura::WindowEventDispatcher* dispatcher = window_->GetDispatcher(); if (!dispatcher) return true; const ui::Event* event = dispatcher->current_event(); if (!event) return true; return is_fullscreen_; } //////////////////////////////////////////////////////////////////////////////// // RenderWidgetHostViewAura, // aura::client::ActivationChangeObserver implementation: void RenderWidgetHostViewAura::OnWindowActivated(aura::Window* gained_active, aura::Window* lost_active) { DCHECK(window_ == gained_active || window_ == lost_active); if (window_ == gained_active) { const ui::Event* event = window_->GetDispatcher()->current_event(); if (event && PointerEventActivates(*event)) host_->OnPointerEventActivate(); } } //////////////////////////////////////////////////////////////////////////////// // RenderWidgetHostViewAura, aura::client::CursorClientObserver implementation: void RenderWidgetHostViewAura::OnCursorVisibilityChanged(bool is_visible) { NotifyRendererOfCursorVisibilityState(is_visible); } //////////////////////////////////////////////////////////////////////////////// // RenderWidgetHostViewAura, aura::client::FocusChangeObserver implementation: void RenderWidgetHostViewAura::OnWindowFocused(aura::Window* gained_focus, aura::Window* lost_focus) { DCHECK(window_ == gained_focus || window_ == lost_focus); if (window_ == gained_focus) { // We need to honor input bypass if the associated tab is does not want // input. This gives the current focused window a chance to be the text // input client and handle events. if (host_->ignore_input_events()) return; host_->GotFocus(); host_->SetActive(true); ui::InputMethod* input_method = GetInputMethod(); if (input_method) { // Ask the system-wide IME to send all TextInputClient messages to |this| // object. input_method->SetFocusedTextInputClient(this); host_->SetInputMethodActive(input_method->IsActive()); // Often the application can set focus to the view in response to a key // down. However the following char event shouldn't be sent to the web // page. host_->SuppressNextCharEvents(); } else { host_->SetInputMethodActive(false); } } else if (window_ == lost_focus) { host_->SetActive(false); host_->Blur(); DetachFromInputMethod(); host_->SetInputMethodActive(false); if (touch_editing_client_) touch_editing_client_->EndTouchEditing(); // If we lose the focus while fullscreen, close the window; Pepper Flash // won't do it for us (unlike NPAPI Flash). However, we do not close the // window if we lose the focus to a window on another display. gfx::Screen* screen = gfx::Screen::GetScreenFor(window_); bool focusing_other_display = gained_focus && screen->GetNumDisplays() > 1 && (screen->GetDisplayNearestWindow(window_).id() != screen->GetDisplayNearestWindow(gained_focus).id()); if (is_fullscreen_ && !in_shutdown_ && !focusing_other_display) { #if defined(OS_WIN) // On Windows, if we are switching to a non Aura Window on a different // screen we should not close the fullscreen window. if (!gained_focus) { POINT point = {0}; ::GetCursorPos(&point); if (screen->GetDisplayNearestWindow(window_).id() != screen->GetDisplayNearestPoint(gfx::Point(point)).id()) return; } #endif in_shutdown_ = true; host_->Shutdown(); } } } //////////////////////////////////////////////////////////////////////////////// // RenderWidgetHostViewAura, aura::RootWindowObserver implementation: void RenderWidgetHostViewAura::OnRootWindowHostMoved( const aura::RootWindow* root, const gfx::Point& new_origin) { UpdateScreenInfo(window_); } //////////////////////////////////////////////////////////////////////////////// // RenderWidgetHostViewAura, SoftwareFrameManagerClient implementation: void RenderWidgetHostViewAura::SoftwareFrameWasFreed( uint32 output_surface_id, unsigned frame_id) { ReleaseSoftwareFrame(output_surface_id, frame_id); } void RenderWidgetHostViewAura::ReleaseReferencesToSoftwareFrame() { ui::Compositor* compositor = GetCompositor(); if (compositor) { AddOnCommitCallbackAndDisableLocks(base::Bind( &RenderWidgetHostViewAura::SendReclaimSoftwareFrames, AsWeakPtr())); } UpdateExternalTexture(); } //////////////////////////////////////////////////////////////////////////////// // RenderWidgetHostViewAura, ui::CompositorObserver implementation: void RenderWidgetHostViewAura::OnCompositingDidCommit( ui::Compositor* compositor) { if (can_lock_compositor_ == NO_PENDING_COMMIT) { can_lock_compositor_ = YES; if (resize_lock_.get() && resize_lock_->GrabDeferredLock()) can_lock_compositor_ = YES_DID_LOCK; } RunOnCommitCallbacks(); if (resize_lock_ && resize_lock_->expected_size() == current_frame_size_) { resize_lock_.reset(); host_->WasResized(); // We may have had a resize while we had the lock (e.g. if the lock expired, // or if the UI still gave us some resizes), so make sure we grab a new lock // if necessary. MaybeCreateResizeLock(); } } void RenderWidgetHostViewAura::OnCompositingStarted( ui::Compositor* compositor, base::TimeTicks start_time) { last_draw_ended_ = start_time; } void RenderWidgetHostViewAura::OnCompositingEnded( ui::Compositor* compositor) { if (paint_observer_) paint_observer_->OnCompositingComplete(); } void RenderWidgetHostViewAura::OnCompositingAborted( ui::Compositor* compositor) { } void RenderWidgetHostViewAura::OnCompositingLockStateChanged( ui::Compositor* compositor) { // A compositor lock that is part of a resize lock timed out. We // should display a renderer frame. if (!compositor->IsLocked() && can_lock_compositor_ == YES_DID_LOCK) { can_lock_compositor_ = NO_PENDING_RENDERER_FRAME; } } void RenderWidgetHostViewAura::OnUpdateVSyncParameters( ui::Compositor* compositor, base::TimeTicks timebase, base::TimeDelta interval) { if (IsShowing()) { if (IsDeadlineSchedulingEnabled()) { // The deadline scheduler has logic to stagger the draws of the // Renderer and Browser built-in, so send it an accurate timebase. host_->UpdateVSyncParameters(timebase, interval); } else if (!last_draw_ended_.is_null()) { // For the non-deadline scheduler, we send the Renderer an offset // vsync timebase to avoid its draws racing the Browser's draws. host_->UpdateVSyncParameters(last_draw_ended_, interval); } } } //////////////////////////////////////////////////////////////////////////////// // RenderWidgetHostViewAura, BrowserAccessibilityDelegate implementation: void RenderWidgetHostViewAura::SetAccessibilityFocus(int acc_obj_id) { if (!host_) return; host_->AccessibilitySetFocus(acc_obj_id); } void RenderWidgetHostViewAura::AccessibilityDoDefaultAction(int acc_obj_id) { if (!host_) return; host_->AccessibilityDoDefaultAction(acc_obj_id); } void RenderWidgetHostViewAura::AccessibilityScrollToMakeVisible( int acc_obj_id, gfx::Rect subfocus) { if (!host_) return; host_->AccessibilityScrollToMakeVisible(acc_obj_id, subfocus); } void RenderWidgetHostViewAura::AccessibilityScrollToPoint( int acc_obj_id, gfx::Point point) { if (!host_) return; host_->AccessibilityScrollToPoint(acc_obj_id, point); } void RenderWidgetHostViewAura::AccessibilitySetTextSelection( int acc_obj_id, int start_offset, int end_offset) { if (!host_) return; host_->AccessibilitySetTextSelection( acc_obj_id, start_offset, end_offset); } gfx::Point RenderWidgetHostViewAura::GetLastTouchEventLocation() const { // Only needed for Win 8 non-aura. return gfx::Point(); } void RenderWidgetHostViewAura::FatalAccessibilityTreeError() { host_->FatalAccessibilityTreeError(); SetBrowserAccessibilityManager(NULL); } //////////////////////////////////////////////////////////////////////////////// // RenderWidgetHostViewAura, ImageTransportFactoryObserver implementation: void RenderWidgetHostViewAura::OnLostResources() { current_surface_ = NULL; UpdateExternalTexture(); // Make sure all ImageTransportClients are deleted now that the context those // are using is becoming invalid. This sends pending ACKs and needs to happen // after calling UpdateExternalTexture() which syncs with the impl thread. RunOnCommitCallbacks(); DCHECK(!shared_surface_handle_.is_null()); ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); factory->DestroySharedSurfaceHandle(shared_surface_handle_); shared_surface_handle_ = factory->CreateSharedSurfaceHandle(); host_->CompositingSurfaceUpdated(); host_->ScheduleComposite(); } //////////////////////////////////////////////////////////////////////////////// // RenderWidgetHostViewAura, private: RenderWidgetHostViewAura::~RenderWidgetHostViewAura() { if (paint_observer_) paint_observer_->OnViewDestroyed(); if (touch_editing_client_) touch_editing_client_->OnViewDestroyed(); if (!shared_surface_handle_.is_null()) { ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); factory->DestroySharedSurfaceHandle(shared_surface_handle_); factory->RemoveObserver(this); } window_observer_.reset(); if (window_->GetDispatcher()) window_->GetDispatcher()->RemoveRootWindowObserver(this); UnlockMouse(); if (popup_parent_host_view_) { DCHECK(popup_parent_host_view_->popup_child_host_view_ == NULL || popup_parent_host_view_->popup_child_host_view_ == this); popup_parent_host_view_->popup_child_host_view_ = NULL; } if (popup_child_host_view_) { DCHECK(popup_child_host_view_->popup_parent_host_view_ == NULL || popup_child_host_view_->popup_parent_host_view_ == this); popup_child_host_view_->popup_parent_host_view_ = NULL; } aura::client::SetTooltipText(window_, NULL); gfx::Screen::GetScreenFor(window_)->RemoveObserver(this); // This call is usually no-op since |this| object is already removed from the // Aura root window and we don't have a way to get an input method object // associated with the window, but just in case. DetachFromInputMethod(); if (resource_collection_.get()) resource_collection_->SetClient(NULL); #if defined(OS_WIN) if (::IsWindow(plugin_parent_window_)) ::DestroyWindow(plugin_parent_window_); #endif } void RenderWidgetHostViewAura::UpdateCursorIfOverSelf() { const gfx::Point screen_point = gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(); aura::Window* root_window = window_->GetRootWindow(); if (!root_window) return; gfx::Rect screen_rect = GetViewBounds(); gfx::Point local_point = screen_point; local_point.Offset(-screen_rect.x(), -screen_rect.y()); #if defined(OS_WIN) // If there's another toplevel window above us at this point (for example a // menu), we don't want to update the cursor. POINT windows_point = { screen_point.x(), screen_point.y() }; aura::WindowEventDispatcher* dispatcher = root_window->GetDispatcher(); if (dispatcher->GetAcceleratedWidget() != ::WindowFromPoint(windows_point)) return; #endif if (root_window->GetEventHandlerForPoint(local_point) != window_) return; gfx::NativeCursor cursor = current_cursor_.GetNativeCursor(); // Do not show loading cursor when the cursor is currently hidden. if (is_loading_ && cursor != ui::kCursorNone) cursor = ui::kCursorPointer; aura::client::CursorClient* cursor_client = aura::client::GetCursorClient(root_window); if (cursor_client) { cursor_client->SetCursor(cursor); } } ui::InputMethod* RenderWidgetHostViewAura::GetInputMethod() const { aura::Window* root_window = window_->GetRootWindow(); if (!root_window) return NULL; return root_window->GetProperty(aura::client::kRootWindowInputMethodKey); } bool RenderWidgetHostViewAura::NeedsInputGrab() { return popup_type_ == WebKit::WebPopupTypeSelect; } void RenderWidgetHostViewAura::FinishImeCompositionSession() { if (!has_composition_text_) return; if (host_) host_->ImeConfirmComposition(string16(), gfx::Range::InvalidRange(), false); ImeCancelComposition(); } void RenderWidgetHostViewAura::ModifyEventMovementAndCoords( WebKit::WebMouseEvent* event) { // If the mouse has just entered, we must report zero movementX/Y. Hence we // reset any global_mouse_position set previously. if (event->type == WebKit::WebInputEvent::MouseEnter || event->type == WebKit::WebInputEvent::MouseLeave) global_mouse_position_.SetPoint(event->globalX, event->globalY); // Movement is computed by taking the difference of the new cursor position // and the previous. Under mouse lock the cursor will be warped back to the // center so that we are not limited by clipping boundaries. // We do not measure movement as the delta from cursor to center because // we may receive more mouse movement events before our warp has taken // effect. event->movementX = event->globalX - global_mouse_position_.x(); event->movementY = event->globalY - global_mouse_position_.y(); global_mouse_position_.SetPoint(event->globalX, event->globalY); // Under mouse lock, coordinates of mouse are locked to what they were when // mouse lock was entered. if (mouse_locked_) { event->x = unlocked_mouse_position_.x(); event->y = unlocked_mouse_position_.y(); event->windowX = unlocked_mouse_position_.x(); event->windowY = unlocked_mouse_position_.y(); event->globalX = unlocked_global_mouse_position_.x(); event->globalY = unlocked_global_mouse_position_.y(); } else { unlocked_mouse_position_.SetPoint(event->windowX, event->windowY); unlocked_global_mouse_position_.SetPoint(event->globalX, event->globalY); } } void RenderWidgetHostViewAura::NotifyRendererOfCursorVisibilityState( bool is_visible) { if (host_->is_hidden() || (cursor_visibility_state_in_renderer_ == VISIBLE && is_visible) || (cursor_visibility_state_in_renderer_ == NOT_VISIBLE && !is_visible)) return; cursor_visibility_state_in_renderer_ = is_visible ? VISIBLE : NOT_VISIBLE; host_->SendCursorVisibilityState(is_visible); } void RenderWidgetHostViewAura::SchedulePaintIfNotInClip( const gfx::Rect& rect, const gfx::Rect& clip) { if (!clip.IsEmpty()) { gfx::Rect to_paint = gfx::SubtractRects(rect, clip); if (!to_paint.IsEmpty()) window_->SchedulePaintInRect(to_paint); } else { window_->SchedulePaintInRect(rect); } } bool RenderWidgetHostViewAura::ShouldMoveToCenter() { gfx::Rect rect = window_->bounds(); rect = ConvertRectToScreen(rect); int border_x = rect.width() * kMouseLockBorderPercentage / 100; int border_y = rect.height() * kMouseLockBorderPercentage / 100; return global_mouse_position_.x() < rect.x() + border_x || global_mouse_position_.x() > rect.right() - border_x || global_mouse_position_.y() < rect.y() + border_y || global_mouse_position_.y() > rect.bottom() - border_y; } void RenderWidgetHostViewAura::RunOnCommitCallbacks() { for (std::vector<base::Closure>::const_iterator it = on_compositing_did_commit_callbacks_.begin(); it != on_compositing_did_commit_callbacks_.end(); ++it) { it->Run(); } on_compositing_did_commit_callbacks_.clear(); } void RenderWidgetHostViewAura::AddOnCommitCallbackAndDisableLocks( const base::Closure& callback) { ui::Compositor* compositor = GetCompositor(); DCHECK(compositor); if (!compositor->HasObserver(this)) compositor->AddObserver(this); can_lock_compositor_ = NO_PENDING_COMMIT; on_compositing_did_commit_callbacks_.push_back(callback); } void RenderWidgetHostViewAura::AddedToRootWindow() { window_->GetDispatcher()->AddRootWindowObserver(this); host_->ParentChanged(GetNativeViewId()); UpdateScreenInfo(window_); if (popup_type_ != WebKit::WebPopupTypeNone) event_filter_for_popup_exit_.reset(new EventFilterForPopupExit(this)); aura::client::CursorClient* cursor_client = aura::client::GetCursorClient(window_->GetRootWindow()); if (cursor_client) { cursor_client->AddObserver(this); NotifyRendererOfCursorVisibilityState(cursor_client->IsCursorVisible()); } if (current_surface_.get()) UpdateExternalTexture(); } void RenderWidgetHostViewAura::RemovingFromRootWindow() { aura::client::CursorClient* cursor_client = aura::client::GetCursorClient(window_->GetRootWindow()); if (cursor_client) cursor_client->RemoveObserver(this); DetachFromInputMethod(); event_filter_for_popup_exit_.reset(); window_->GetDispatcher()->RemoveRootWindowObserver(this); host_->ParentChanged(0); ui::Compositor* compositor = GetCompositor(); if (current_surface_.get()) { // We can't get notification for commits after this point, which would // guarantee that the compositor isn't using an old texture any more, so // instead we force the layer to stop using any external resources which // synchronizes with the compositor thread, and makes it safe to run the // callback. window_->layer()->SetShowPaintedContent(); } RunOnCommitCallbacks(); resize_lock_.reset(); host_->WasResized(); if (compositor && compositor->HasObserver(this)) compositor->RemoveObserver(this); } ui::Compositor* RenderWidgetHostViewAura::GetCompositor() const { aura::WindowEventDispatcher* dispatcher = window_->GetDispatcher(); return dispatcher ? dispatcher->compositor() : NULL; } void RenderWidgetHostViewAura::DetachFromInputMethod() { ui::InputMethod* input_method = GetInputMethod(); if (input_method && input_method->GetTextInputClient() == this) input_method->SetFocusedTextInputClient(NULL); } //////////////////////////////////////////////////////////////////////////////// // RenderWidgetHostView, public: // static RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget( RenderWidgetHost* widget) { return new RenderWidgetHostViewAura(widget); } // static void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { GetScreenInfoForWindow(results, NULL); } } // namespace content
[ "Khilan.Gudka@cl.cam.ac.uk" ]
Khilan.Gudka@cl.cam.ac.uk
e7e271489aadd58cdad9e423971ef879ef11dbb2
79487524fd7a6fbbe32e3e57b8aa5f150668ccfc
/Source/vtkDICOMValue.cxx
391889f7fbde4c272582c79ccea3931b1cb6d62f
[]
no_license
lorensen/vtk-dicom
067be771c2047c062123b2f2ad6848be19e32106
8664858b456607543e611c1e3ff7d3558e063134
refs/heads/master
2021-01-17T16:07:21.506708
2015-07-07T23:29:01
2015-07-07T23:29:01
38,824,130
1
0
null
2015-07-09T14:08:04
2015-07-09T14:08:04
null
UTF-8
C++
false
false
68,883
cxx
/*========================================================================= Program: DICOM for VTK Copyright (c) 2012-2015 David Gobbi All rights reserved. See Copyright.txt or http://dgobbi.github.io/bsd3.txt for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ #include "vtkDICOMValue.h" #include "vtkDICOMItem.h" #include "vtkDICOMSequence.h" #include "vtkDICOMUtilities.h" #include <vtkMath.h> #include <vtkTypeTraits.h> #include <math.h> #include <float.h> #include <stdlib.h> #include <stddef.h> #include <assert.h> #include <new> // For use by methods that must return an empty item const vtkDICOMItem vtkDICOMValue::EmptyItem; //---------------------------------------------------------------------------- // Use anonymous namespace to limit function scope to this file only namespace { // Cast an array of "n" values from type "IT" to type "OT". template<class IT, class OT> void NumericalConversion(IT *u, OT *v, size_t n) { if (n != 0) { do { *v++ = static_cast<OT>(*u++); } while (--n); } } // Check for hexadecimal digits, plain ASCII (don't use locale) bool IsHexDigit(char c) { return ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f')); } // The input is a list of one or more numerical string values separated // by backslashes, for example "1.23435\85234.0\2345.22". Convert "n" // values to type OT, starting at the "i"th backslash-separated value. // If the VR is IS (integer string) then use strol(), if DS use strtod(). template<class OT> void StringConversion( const char *cp, vtkDICOMVR vr, OT *v, size_t i, size_t n) { if (vr == vtkDICOMVR::IS || vr == vtkDICOMVR::DS) { for (size_t j = 0; j < i && *cp != '\0'; j++) { bool bk = false; do { bk = (*cp == '\\'); cp++; } while (!bk && *cp != '\0'); } for (size_t k = 0; k < n && *cp != '\0'; k++) { if (vr == vtkDICOMVR::DS) { *v++ = static_cast<OT>(strtod(cp, NULL)); } else { *v++ = static_cast<OT>(strtol(cp, NULL, 10)); } bool bk = false; do { bk = (*cp == '\\'); cp++; } while (!bk && *cp != '\0'); } } else if (n > 0) { do { *v++ = 0; } while (--n); } } // specialize conversion for vtkDICOMTag void StringConversionAT(const char *cp, vtkDICOMTag *v, size_t n) { for (size_t k = 0; k < n && *cp != '\0'; k++) { while (!IsHexDigit(*cp) && *cp != '\\' && *cp != '\0') { cp++; } const char *dp = cp; while (IsHexDigit(*dp)) { dp++; } while (!IsHexDigit(*dp) && *dp != '\\' && *dp != '\0') { dp++; } unsigned short g = static_cast<unsigned short>(strtol(cp, NULL, 16)); unsigned short e = static_cast<unsigned short>(strtol(dp, NULL, 16)); *v++ = vtkDICOMTag(g, e); bool bk = false; do { bk = (*cp == '\\'); cp++; } while (!bk && *cp != '\0'); } } // custom allocator void *ValueMalloc(size_t size) { void *vp = 0; while ((vp = malloc(size)) == 0) { // for C++11, get_new_handler is preferred std::new_handler global_handler = std::set_new_handler(0); std::set_new_handler(global_handler); if (global_handler) { global_handler(); } else { throw std::bad_alloc(); } } return vp; } // custom deallocator void ValueFree(void *vp) { free(vp); } } // end anonymous namespace #ifdef VTK_DICOM_USE_OVERFLOW_BYTE #define OVERFLOW_BYTE(vn) static_cast<unsigned char>(vn >> 32) #else #define OVERFLOW_BYTE(vn) 0 #endif //---------------------------------------------------------------------------- // Construct a numerical value. template<class T> vtkDICOMValue::ValueT<T>::ValueT(vtkDICOMVR vr, size_t vn) { this->Type = static_cast<unsigned char>(vtkTypeTraits<T>::VTKTypeID()); this->CharacterSet = 0; this->Overflow = OVERFLOW_BYTE(vn); this->VR = vr; this->VL = vn*sizeof(T); this->NumberOfValues = vn; } // Construct a string value. template<> vtkDICOMValue::ValueT<char>::ValueT(vtkDICOMVR vr, size_t vn) { vn += (vn & 1); // pad VL to make it even this->Type = VTK_CHAR; this->CharacterSet = 0; this->Overflow = OVERFLOW_BYTE(vn); this->VR = vr; this->VL = vn; this->NumberOfValues = (vn > 0); } // Construct a "bytes" value. template<> vtkDICOMValue::ValueT<unsigned char>::ValueT(vtkDICOMVR vr, size_t vn) { this->Type = VTK_UNSIGNED_CHAR; this->CharacterSet = 0; this->Overflow = OVERFLOW_BYTE(vn); this->VR = vr; this->VL = vn + (vn & 1); // pad VL to make it even this->NumberOfValues = vn; } // Construct a list of attribute tags. template<> vtkDICOMValue::ValueT<vtkDICOMTag>::ValueT(vtkDICOMVR vr, size_t vn) { this->Type = VTK_DICOM_TAG; this->CharacterSet = 0; this->Overflow = OVERFLOW_BYTE(vn); this->VR = vr; this->VL = 4*vn; this->NumberOfValues = vn; vtkDICOMTag *dp = this->Data; for (size_t i = 0; i < vn; i++) { // call constructor manually with placement new new(dp) vtkDICOMTag(); dp++; } } // Construct a sequence of items. template<> vtkDICOMValue::ValueT<vtkDICOMItem>::ValueT(vtkDICOMVR vr, size_t vn) { this->Type = VTK_DICOM_ITEM; this->CharacterSet = 0; this->Overflow = OVERFLOW_BYTE(vn); this->VR = vr; // better be SQ this->VL = 0; this->NumberOfValues = vn; vtkDICOMItem *dp = this->Data; for (size_t i = 0; i < vn; i++) { // call constructor manually with placement new new(dp) vtkDICOMItem(); dp++; } } // Construct a list of values. template<> vtkDICOMValue::ValueT<vtkDICOMValue>::ValueT(vtkDICOMVR vr, size_t vn) { this->Type = VTK_DICOM_VALUE; this->CharacterSet = 0; this->Overflow = OVERFLOW_BYTE(vn); this->VR = vr; this->VL = 0; this->NumberOfValues = vn; vtkDICOMValue *dp = this->Data; for (size_t i = 0; i < vn; i++) { // call constructor manually with placement new new(dp) vtkDICOMValue(); dp++; } } //---------------------------------------------------------------------------- vtkDICOMValue::vtkDICOMValue(const vtkDICOMSequence &s) { this->V = s.V.V; if (this->V) { ++(this->V->ReferenceCount); } } vtkDICOMValue& vtkDICOMValue::operator=(const vtkDICOMSequence& o) { *this = o.V; return *this; } template<class T> T *vtkDICOMValue::Allocate(vtkDICOMVR vr, size_t vn) { this->Clear(); // Use C++ "placement new" to allocate a single block of memory that // includes both the Value struct and the array of values. size_t n = vn + !vn; // add one if zero void *vp = ValueMalloc(sizeof(Value) + n*sizeof(T)); ValueT<T> *v = new(vp) ValueT<T>(vr, vn); // Test the assumption that Data is at an offset of sizeof(Value) assert(static_cast<char *>(static_cast<void *>(v->Data)) == static_cast<char *>(vp) + sizeof(Value)); this->V = v; return v->Data; } template<> unsigned char *vtkDICOMValue::Allocate(vtkDICOMVR vr, size_t vn) { this->Clear(); // Use C++ "placement new" to allocate a single block of memory that // includes both the Value struct and the array of values. size_t n = vn + !vn; // add one if zero void *vp = ValueMalloc(sizeof(Value) + n); ValueT<unsigned char> *v = new(vp) ValueT<unsigned char>(vr, vn); // Test the assumption that Data is at an offset of sizeof(Value) assert(static_cast<char *>(static_cast<void *>(v->Data)) == static_cast<char *>(vp) + sizeof(Value)); this->V = v; return v->Data; } template<> char *vtkDICOMValue::Allocate<char>(vtkDICOMVR vr, size_t vn) { this->Clear(); // Strings of any type other than UI will be padded with spaces to // give an even number of chars. All strings (including UI) need one // extra char for the null terminator to make them valid C strings. size_t pad = (vn & static_cast<size_t>(vr != vtkDICOMVR::UI)); // Use C++ "placement new" to allocate a single block of memory that // includes both the Value struct and the array of values. void *vp = ValueMalloc(sizeof(Value) + vn + pad + 1); ValueT<char> *v = new(vp) ValueT<char>(vr, vn); // Test the assumption that Data is at an offset of sizeof(Value) assert(v->Data == static_cast<char *>(vp) + sizeof(Value)); this->V = v; return v->Data; } char *vtkDICOMValue::AllocateCharData(vtkDICOMVR vr, size_t vn) { return this->Allocate<char>(vr, vn); } char *vtkDICOMValue::AllocateCharData( vtkDICOMVR vr, vtkDICOMCharacterSet cs, size_t vn) { char *data = this->Allocate<char>(vr, vn); if (vr.HasSpecificCharacterSet() && this->V) { this->V->CharacterSet = cs.GetKey(); } return data; } unsigned char *vtkDICOMValue::AllocateUnsignedCharData( vtkDICOMVR vr, size_t vn) { return this->Allocate<unsigned char>(vr, vn); } short *vtkDICOMValue::AllocateShortData(vtkDICOMVR vr, size_t vn) { return this->Allocate<short>(vr, vn); } unsigned short *vtkDICOMValue::AllocateUnsignedShortData( vtkDICOMVR vr, size_t vn) { return this->Allocate<unsigned short>(vr, vn); } int *vtkDICOMValue::AllocateIntData(vtkDICOMVR vr, size_t vn) { return this->Allocate<int>(vr, vn); } unsigned int *vtkDICOMValue::AllocateUnsignedIntData( vtkDICOMVR vr, size_t vn) { return this->Allocate<unsigned int>(vr, vn); } float *vtkDICOMValue::AllocateFloatData(vtkDICOMVR vr, size_t vn) { return this->Allocate<float>(vr, vn); } double *vtkDICOMValue::AllocateDoubleData(vtkDICOMVR vr, size_t vn) { return this->Allocate<double>(vr, vn); } vtkDICOMTag *vtkDICOMValue::AllocateTagData( vtkDICOMVR vr, size_t vn) { return this->Allocate<vtkDICOMTag>(vr, vn); } vtkDICOMItem *vtkDICOMValue::AllocateSequenceData( vtkDICOMVR vr, size_t vn) { return this->Allocate<vtkDICOMItem>(vr, vn); } vtkDICOMValue *vtkDICOMValue::AllocateMultiplexData( vtkDICOMVR vr, size_t vn) { return this->Allocate<vtkDICOMValue>(vr, vn); } //---------------------------------------------------------------------------- void vtkDICOMValue::ComputeNumberOfValuesForCharData() { if (this->V && this->V->Type == VTK_CHAR) { if (this->V->VL == 0) { this->V->NumberOfValues = 0; } else if (this->V->VR.HasSingleValue()) { this->V->NumberOfValues = 1; } else { const char *ptr = static_cast<const ValueT<char> *>(this->V)->Data; unsigned int n = 1; size_t vl = this->V->VL; if (this->V->CharacterSet == 0) { do { n += (*ptr++ == '\\'); } while (--vl); } else { vtkDICOMCharacterSet cs = this->GetCharacterSet(); n += cs.CountBackslashes(ptr, vl); } this->V->NumberOfValues = n; } } } //---------------------------------------------------------------------------- unsigned char *vtkDICOMValue::ReallocateUnsignedCharData(size_t vn) { assert(this->V != 0); assert(this->V->VR == vtkDICOMVR::OB || this->V->VR == vtkDICOMVR::UN); assert(vn < 0xffffffffu); size_t n = this->GetNumberOfValues(); unsigned char *ptr = static_cast<ValueT<unsigned char> *>(this->V)->Data; Value *v = this->V; const unsigned char *cptr = ptr; // increment ref count before reallocating ++(v->ReferenceCount); ptr = this->AllocateUnsignedCharData(v->VR, vn); n = (n < vn ? n : vn); if (n > 0) { memcpy(ptr, cptr, n); } // indicate encapsulated contents this->V->VL = 0xffffffff; // decrement the refcount of the old V if (--(v->ReferenceCount) == 0) { vtkDICOMValue::FreeValue(v); } return ptr; } //---------------------------------------------------------------------------- template<class T> void vtkDICOMValue::CreateValue(vtkDICOMVR vr, const T *data, size_t n) { typedef vtkDICOMVR VR; // shorthand assert(n*sizeof(T) < 0xffffffffu); int vt = vtkTypeTraits<T>::VTKTypeID(); this->V = 0; if (vr == VR::OX) { // OX means "OB or OW", use type to find out which vr = (vt == VTK_UNSIGNED_CHAR ? VR::OB : VR::OW); } else if (vr == VR::XS) { // XS means "SS or US", use type to find out which vr = (vt == VTK_UNSIGNED_SHORT ? VR::US : VR::SS); } // use VR to set data type, then convert input to that type if (vr == VR::FD) { double *ptr = this->AllocateDoubleData(vr, n); NumericalConversion(data, ptr, n); } else if (vr == VR::FL) { float *ptr = this->AllocateFloatData(vr, n); NumericalConversion(data, ptr, n); } else if (vr == VR::UL) { unsigned int *ptr = this->AllocateUnsignedIntData(vr, n); NumericalConversion(data, ptr, n); } else if (vr == VR::SL) { int *ptr = this->AllocateIntData(vr, n); NumericalConversion(data, ptr, n); } else if (vr == VR::US) { unsigned short *ptr = this->AllocateUnsignedShortData(vr, n); NumericalConversion(data, ptr, n); } else if (vr == VR::SS) { short *ptr = this->AllocateShortData(vr, n); NumericalConversion(data, ptr, n); } else if (vr == VR::DS) { char *cp = this->AllocateCharData(vr, 17*n); char *dp = cp; for (size_t i = 0; i < n; i++) { double d = static_cast<double>(data[i]); // clamp to the range allowed for DICOM decimal strings if (d > 9.999999999e+99) { d = 9.999999999e+99; } else if (d < -9.999999999e+99) { d = -9.999999999e+99; } else if (fabs(d) < 1e-99 || vtkMath::IsNan(d)) { d = 0.0; } // use a precision that will use 16 characters maximum sprintf(cp, "%.10g", d); size_t dl = strlen(cp); // look for extra leading zeros on exponent if (dl >= 5 && (cp[dl-5] == 'e' || cp[dl-5] =='E') && cp[dl-3] == '0') { cp[dl-3] = cp[dl-2]; cp[dl-2] = cp[dl-1]; cp[dl-1] = '\0'; dl--; } cp += dl; *cp++ = '\\'; } if (cp != dp) { --cp; } this->V->NumberOfValues = static_cast<unsigned int>(n); this->V->VL = static_cast<unsigned int>(cp - dp); if (this->V->VL & 1) { // pad to even number of chars *cp++ = ' '; this->V->VL++; } *cp = '\0'; } else if (vr == VR::IS) { char *cp = this->AllocateCharData(vr, 13*n); char *dp = cp; for (size_t i = 0; i < n; i++) { sprintf(cp, "%i", static_cast<int>(data[i])); cp += strlen(cp); *cp++ = '\\'; } if (cp != dp) { --cp; } this->V->NumberOfValues = static_cast<unsigned int>(n); this->V->VL = static_cast<unsigned int>(cp - dp); if (this->V->VL & 1) { // pad to even number of chars *cp++ = ' '; this->V->VL++; } *cp = '\0'; } else if (vr == VR::OB || vr == VR::UN) { size_t m = n*sizeof(T); int pad = (m & 1); unsigned char *ptr = this->AllocateUnsignedCharData(vr, m + pad); memcpy(ptr, data, m); if (pad) { ptr[m] = 0; } // pad to even this->V->NumberOfValues = static_cast<unsigned int>(m); } else if (vr == VR::OW) { if (vt == VTK_UNSIGNED_SHORT) { unsigned short *ptr = this->AllocateUnsignedShortData(vr, n); memcpy(ptr, data, n*2); } else { short *ptr = this->AllocateShortData(vr, n*sizeof(T)/2); memcpy(ptr, data, n*sizeof(T)); } } else if (vr == VR::OF) { float *ptr = this->AllocateFloatData(vr, n*sizeof(T)/4); memcpy(ptr, data, n*sizeof(T)); } else if (vr == VR::OD) { double *ptr = this->AllocateDoubleData(vr, n*sizeof(T)/8); memcpy(ptr, data, n*sizeof(T)); } else if (vr == VR::AT) { if (sizeof(T) > 2) { // subsequent values represent 32-bit keys vtkDICOMTag *ptr = this->AllocateTagData(vr, n); for (size_t i = 0; i < n; i++) { unsigned int k = static_cast<unsigned int>(data[i]); unsigned short g = static_cast<unsigned short>(k >> 16); unsigned short e = static_cast<unsigned short>(k); ptr[i] = vtkDICOMTag(g,e); } } else { // subsequent values represent group,element pairs vtkDICOMTag *ptr = this->AllocateTagData(vr, n/2); for (size_t i = 0; i < n; i += 2) { unsigned short g = static_cast<unsigned short>(data[i]); unsigned short e = static_cast<unsigned short>(data[i+1]); ptr[i/2] = vtkDICOMTag(g,e); } } } } template<> void vtkDICOMValue::CreateValue<vtkDICOMTag>( vtkDICOMVR vr, const vtkDICOMTag *data, size_t n) { typedef vtkDICOMVR VR; // shorthand assert(n*4 < 0xffffffffu); this->V = 0; if (vr == VR::AT) { vtkDICOMTag *ptr = this->AllocateTagData(vr, n); for (size_t i = 0; i < n; i++) { ptr[i] = data[i]; } } } template<> void vtkDICOMValue::CreateValue<vtkDICOMItem>( vtkDICOMVR vr, const vtkDICOMItem *data, size_t n) { typedef vtkDICOMVR VR; // shorthand assert(n*4 < 0xffffffffu); this->V = 0; if (vr == VR::SQ) { vtkDICOMItem *ptr = this->AllocateSequenceData(vr, n); for (size_t i = 0; i < n; i++) { ptr[i] = data[i]; } } } template<> void vtkDICOMValue::CreateValue<char>( vtkDICOMVR vr, const char *data, size_t m) { typedef vtkDICOMVR VR; assert(m < 0xffffffffu); this->V = 0; // directly copy data into these VRs without conversion if (vr.HasSingleValue()) { int pad = (m & 1); char *ptr = this->AllocateCharData(vr, m + pad); memcpy(ptr, data, m); // pad to even length with a space if (pad) { ptr[m++] = ' '; } ptr[m] = '\0'; this->V->NumberOfValues = 1; } else if (vr == VR::OW) { short *ptr = this->AllocateShortData(vr, m/2); memcpy(ptr, data, m); } else if (vr == VR::OF) { float *ptr = this->AllocateFloatData(vr, m/4); memcpy(ptr, data, m); } else if (vr == VR::OD) { double *ptr = this->AllocateDoubleData(vr, m/8); memcpy(ptr, data, m); } else if (vr == VR::UN || vr == VR::OB || vr == VR::OX) { int pad = (m & 1); unsigned char *ptr = this->AllocateUnsignedCharData(vr, m + pad); memcpy(ptr, data, m); // pad to even length with a null if (pad != 0) { ptr[m] = 0; } } if (this->V) { return; } // count the number of backslash-separated values size_t n = (m > 0); for (size_t i = 0; i < m; i++) { n += (data[i] == '\\'); } // convert input string to the specified VR if (vr.HasTextValue()) { int pad = (m & 1); char *cp = this->AllocateCharData(vr, m); strncpy(cp, data, m); // if not UI, then pad to even length with a space if (pad && vr != VR::UI) { cp[m++] = ' '; } cp[m] = '\0'; this->V->NumberOfValues = static_cast<unsigned int>(n); } else if (vr == VR::FD) { double *ptr = this->AllocateDoubleData(vr, n); StringConversion(data, VR::DS, ptr, 0, n); } else if (vr == VR::FL) { float *ptr = this->AllocateFloatData(vr, n); StringConversion(data, VR::DS, ptr, 0, n); } else if (vr == VR::UL) { unsigned int *ptr = this->AllocateUnsignedIntData(vr, n); StringConversion(data, VR::IS, ptr, 0, n); } else if (vr == VR::SL) { int *ptr = this->AllocateIntData(vr, n); StringConversion(data, VR::IS, ptr, 0, n); } else if (vr == VR::US) { unsigned short *ptr = this->AllocateUnsignedShortData(vr, n); StringConversion(data, VR::IS, ptr, 0, n); } else if (vr == VR::SS || vr == VR::XS) { short *ptr = this->AllocateShortData(vr, n); StringConversion(data, VR::IS, ptr, 0, n); } else if (vr == VR::AT) { vtkDICOMTag *ptr = this->AllocateTagData(vr, n); StringConversionAT(data, ptr, n); } } //---------------------------------------------------------------------------- // Constructor methods call the factory to create the right internal type. vtkDICOMValue::vtkDICOMValue(vtkDICOMVR vr, double v) { this->CreateValue(vr, &v, 1); } vtkDICOMValue::vtkDICOMValue(vtkDICOMVR vr, const std::string& v) { this->CreateValue(vr, v.data(), v.size()); } vtkDICOMValue::vtkDICOMValue(vtkDICOMVR vr, vtkDICOMTag v) { this->CreateValue(vr, &v, 1); } vtkDICOMValue::vtkDICOMValue(vtkDICOMTag v) { this->CreateValue(vtkDICOMVR::AT, &v, 1); } vtkDICOMValue::vtkDICOMValue(vtkDICOMVR vr, const vtkDICOMItem& v) { this->CreateValue(vr, &v, 1); } vtkDICOMValue::vtkDICOMValue(const vtkDICOMItem& v) { this->CreateValue(vtkDICOMVR::SQ, &v, 1); } vtkDICOMValue::vtkDICOMValue( vtkDICOMVR vr, const char *data, size_t count) { this->CreateValue(vr, data, count); } vtkDICOMValue::vtkDICOMValue( vtkDICOMVR vr, const unsigned char *data, size_t count) { this->CreateValue(vr, data, count); } vtkDICOMValue::vtkDICOMValue( vtkDICOMVR vr, const short *data, size_t count) { this->CreateValue(vr, data, count); } vtkDICOMValue::vtkDICOMValue( vtkDICOMVR vr, const unsigned short *data, size_t count) { this->CreateValue(vr, data, count); } vtkDICOMValue::vtkDICOMValue( vtkDICOMVR vr, const int *data, size_t count) { this->CreateValue(vr, data, count); } vtkDICOMValue::vtkDICOMValue( vtkDICOMVR vr, const unsigned int *data, size_t count) { this->CreateValue(vr, data, count); } vtkDICOMValue::vtkDICOMValue( vtkDICOMVR vr, const float *data, size_t count) { this->CreateValue(vr, data, count); } vtkDICOMValue::vtkDICOMValue( vtkDICOMVR vr, const double *data, size_t count) { this->CreateValue(vr, data, count); } vtkDICOMValue::vtkDICOMValue( vtkDICOMVR vr, const vtkDICOMTag *data, size_t count) { this->CreateValue(vr, data, count); } vtkDICOMValue::vtkDICOMValue( vtkDICOMVR vr, const vtkDICOMItem *data, size_t count) { this->CreateValue(vr, data, count); } //---------------------------------------------------------------------------- void vtkDICOMValue::CreateValueWithSpecificCharacterSet( vtkDICOMVR vr, vtkDICOMCharacterSet cs, const char *data, size_t l) { this->CreateValue(vr, data, l); if (vr.HasSpecificCharacterSet() && this->V) { this->V->CharacterSet = cs.GetKey(); // character set might change interpretation of backslashes if (cs.GetKey() > vtkDICOMCharacterSet::ISO_IR_192) { this->ComputeNumberOfValuesForCharData(); } } } vtkDICOMValue::vtkDICOMValue( vtkDICOMVR vr, vtkDICOMCharacterSet cs, const char *data, size_t l) { this->CreateValueWithSpecificCharacterSet(vr, cs, data, l); } vtkDICOMValue::vtkDICOMValue( vtkDICOMVR vr, vtkDICOMCharacterSet cs, const std::string& v) { this->CreateValueWithSpecificCharacterSet(vr, cs, v.data(), v.size()); } //---------------------------------------------------------------------------- vtkDICOMValue::vtkDICOMValue(vtkDICOMVR vr) { typedef vtkDICOMVR VR; this->V = 0; if (vr.HasTextValue()) { this->AllocateCharData(vr, 0); } else if (vr == VR::OW || vr == VR::OX) { this->AllocateShortData(VR::OW, 0); } else if (vr == VR::OF || vr == VR::FL) { this->AllocateFloatData(vr, 0); } else if (vr == VR::OD || vr == VR::FD) { this->AllocateDoubleData(vr, 0); } else if (vr == VR::OB || vr == VR::UN) { this->AllocateUnsignedCharData(vr, 0); } else if (vr == VR::UL) { this->AllocateUnsignedIntData(vr, 0); } else if (vr == VR::SL) { this->AllocateIntData(vr, 0); } else if (vr == VR::US) { this->AllocateUnsignedShortData(vr, 0); } else if (vr == VR::SS || vr == VR::XS) { this->AllocateShortData(VR::SS, 0); } else if (vr == VR::AT) { this->AllocateTagData(vr, 0); } else if (vr == VR::SQ) { this->AllocateSequenceData(vr, 0); } } //---------------------------------------------------------------------------- // It is necessary to check the Type so that the correct information can // be freed. The constructor guarantees that Type is always set correctly. void vtkDICOMValue::FreeValue(Value *v) { if (v) { if (v->Type == VTK_DICOM_ITEM) { vtkDICOMItem *dp = static_cast<ValueT<vtkDICOMItem> *>(v)->Data; for (size_t i = 0; i < v->NumberOfValues; i++) { // placement new was used, so destructor must be called manually dp->~vtkDICOMItem(); dp++; } } else if (v->Type == VTK_DICOM_VALUE) { vtkDICOMValue *dp = static_cast<ValueT<vtkDICOMValue> *>(v)->Data; for (size_t i = 0; i < v->NumberOfValues; i++) { // placement new was used, so destructor must be called manually dp->~vtkDICOMValue(); dp++; } } ValueFree(v); } } //---------------------------------------------------------------------------- template<class T> void vtkDICOMValue::AppendInit(vtkDICOMVR vr) { this->Clear(); this->Allocate<T>(vr, 2); // mark as empty but growable this->V->NumberOfValues = 0; this->V->VL = 0xffffffff; } template void vtkDICOMValue::AppendInit<vtkDICOMItem>(vtkDICOMVR vr); //---------------------------------------------------------------------------- template<class T> void vtkDICOMValue::AppendValue(const T &item) { // do nothing if not initialized yet if (this->V == 0) { return; } T *ptr = static_cast<vtkDICOMValue::ValueT<T> *>(this->V)->Data; size_t n = this->V->NumberOfValues; size_t nn = 0; // reallocate if not unique reference, or not yet growable if (this->V->ReferenceCount != 1 || this->V->VL != 0xffffffff) { // get next power of two that is greater than n nn = 1; do { nn <<= 1; } while (nn <= n); } // reallocate if n is a power of two else if (n > 1 && ((n - 1) & n) == 0) { nn = 2*n; } // reallocate the array if (nn != 0) { vtkDICOMValue::Value *v = this->V; ++(v->ReferenceCount); const T *cptr = ptr; ptr = this->Allocate<T>(v->VR, nn); this->V->NumberOfValues = static_cast<unsigned int>(n); for (size_t i = 0; i < n; i++) { ptr[i] = cptr[i]; } if (--(v->ReferenceCount) == 0) { vtkDICOMValue::FreeValue(v); } } // mark as growable this->V->VL = 0xffffffff; // add the item ptr[this->V->NumberOfValues++] = item; } template void vtkDICOMValue::AppendValue<vtkDICOMItem>( const vtkDICOMItem& item); //---------------------------------------------------------------------------- template<class T> void vtkDICOMValue::SetValue(size_t i, const T &item) { assert(this->V != 0); assert(i < this->V->NumberOfValues); T *ptr = static_cast<vtkDICOMValue::ValueT<T> *>(this->V)->Data; // reallocate the array if we aren't the sole owner assert(this->V->ReferenceCount == 1); if (this->V->ReferenceCount != 1) { size_t m = this->V->NumberOfValues; const T *cptr = ptr; ptr = this->Allocate<T>(this->V->VR, m); for (size_t j = 0; j < m; j++) { ptr[j] = cptr[j]; } } ptr[i] = item; } template void vtkDICOMValue::SetValue<vtkDICOMItem>( size_t i, const vtkDICOMItem& item); //---------------------------------------------------------------------------- const char *vtkDICOMValue::GetCharData() const { const char *ptr = 0; if (this->V && this->V->Type == VTK_CHAR) { ptr = static_cast<const ValueT<char> *>(this->V)->Data; } return ptr; } const unsigned char *vtkDICOMValue::GetUnsignedCharData() const { const unsigned char *ptr = 0; if (this->V && this->V->Type == VTK_UNSIGNED_CHAR) { ptr = static_cast<const ValueT<unsigned char> *>(this->V)->Data; } return ptr; } const short *vtkDICOMValue::GetShortData() const { const short *ptr = 0; if (this->V) { if (this->V->Type == VTK_SHORT) { ptr = static_cast<const ValueT<short> *>(this->V)->Data; } else if (this->V->Type == VTK_UNSIGNED_SHORT && this->V->VR == vtkDICOMVR::OW) { ptr = reinterpret_cast<const short *>( static_cast<const ValueT<unsigned short> *>(this->V)->Data); } } return ptr; } const unsigned short *vtkDICOMValue::GetUnsignedShortData() const { const unsigned short *ptr = 0; if (this->V) { if (this->V->Type == VTK_UNSIGNED_SHORT) { ptr = static_cast<const ValueT<unsigned short> *>(this->V)->Data; } else if (this->V->Type == VTK_SHORT && this->V->VR == vtkDICOMVR::OW) { ptr = reinterpret_cast<const unsigned short *>( static_cast<const ValueT<short> *>(this->V)->Data); } } return ptr; } const int *vtkDICOMValue::GetIntData() const { const int *ptr = 0; if (this->V && this->V->Type == VTK_INT) { ptr = static_cast<const ValueT<int> *>(this->V)->Data; } return ptr; } const unsigned int *vtkDICOMValue::GetUnsignedIntData() const { const unsigned int *ptr = 0; if (this->V && this->V->Type == VTK_UNSIGNED_INT) { ptr = static_cast<const ValueT<unsigned int> *>(this->V)->Data; } return ptr; } const float *vtkDICOMValue::GetFloatData() const { const float *ptr = 0; if (this->V && this->V->Type == VTK_FLOAT) { ptr = static_cast<const ValueT<float> *>(this->V)->Data; } return ptr; } const double *vtkDICOMValue::GetDoubleData() const { const double *ptr = 0; if (this->V && this->V->Type == VTK_DOUBLE) { ptr = static_cast<const ValueT<double> *>(this->V)->Data; } return ptr; } const vtkDICOMTag *vtkDICOMValue::GetTagData() const { const vtkDICOMTag *ptr = 0; if (this->V && this->V->Type == VTK_DICOM_TAG) { ptr = static_cast<const ValueT<vtkDICOMTag> *>(this->V)->Data; } return ptr; } const vtkDICOMItem *vtkDICOMValue::GetSequenceData() const { const vtkDICOMItem *ptr = 0; if (this->V && this->V->Type == VTK_DICOM_ITEM) { ptr = static_cast<const ValueT<vtkDICOMItem> *>(this->V)->Data; } return ptr; } const vtkDICOMValue *vtkDICOMValue::GetMultiplexData() const { const vtkDICOMValue *ptr = 0; if (this->V && this->V->Type == VTK_DICOM_VALUE) { ptr = static_cast<const ValueT<vtkDICOMValue> *>(this->V)->Data; } return ptr; } vtkDICOMValue *vtkDICOMValue::GetMultiplex() { vtkDICOMValue *ptr = 0; if (this->V && this->V->Type == VTK_DICOM_VALUE) { ptr = static_cast<ValueT<vtkDICOMValue> *>(this->V)->Data; } return ptr; } //---------------------------------------------------------------------------- template<class VT> void vtkDICOMValue::GetValuesT(VT *v, size_t c, size_t s) const { switch (this->V->Type) { case VTK_CHAR: StringConversion( static_cast<const ValueT<char> *>(this->V)->Data, this->V->VR, v, s, c); break; case VTK_UNSIGNED_CHAR: NumericalConversion( static_cast<const ValueT<unsigned char> *>(this->V)->Data+s, v, c); break; case VTK_SHORT: NumericalConversion( static_cast<const ValueT<short> *>(this->V)->Data+s, v, c); break; case VTK_UNSIGNED_SHORT: NumericalConversion( static_cast<const ValueT<unsigned short> *>(this->V)->Data+s, v, c); break; case VTK_INT: NumericalConversion( static_cast<const ValueT<int> *>(this->V)->Data+s, v, c); break; case VTK_UNSIGNED_INT: NumericalConversion( static_cast<const ValueT<unsigned int> *>(this->V)->Data+s, v, c); break; case VTK_FLOAT: NumericalConversion( static_cast<const ValueT<float> *>(this->V)->Data+s, v, c); break; case VTK_DOUBLE: NumericalConversion( static_cast<const ValueT<double> *>(this->V)->Data+s, v, c); break; case VTK_DICOM_TAG: { const vtkDICOMTag *tptr = static_cast<const ValueT<vtkDICOMTag> *>(this->V)->Data + s; for (size_t i = 0; i < c; i += 2) { v[i] = static_cast<VT>(tptr[i/2].GetGroup()); v[i+1] = static_cast<VT>(tptr[i/2].GetElement()); } } break; } } template<> void vtkDICOMValue::GetValuesT<std::string>( std::string *v, size_t c, size_t s) const { for (size_t i = 0; i < c; i++) { v->clear(); this->AppendValueToString(*v++, s++); } } template<> void vtkDICOMValue::GetValuesT<vtkDICOMTag>( vtkDICOMTag *v, size_t c, size_t s) const { if (this->V->Type == VTK_DICOM_TAG) { const vtkDICOMTag *ptr = static_cast<const ValueT<vtkDICOMTag> *>(this->V)->Data + s; for (size_t i = 0; i < c; i++) { *v++ = *ptr++; } } } //---------------------------------------------------------------------------- // These are interface methods that call the templated internal methods. void vtkDICOMValue::GetValues(unsigned char *v, size_t c, size_t s) const { assert((s + c) <= this->V->NumberOfValues); this->GetValuesT(v, c, s); } void vtkDICOMValue::GetValues(short *v, size_t c, size_t s) const { assert((s + c) <= this->V->NumberOfValues); this->GetValuesT(v, c, s); } void vtkDICOMValue::GetValues(unsigned short *v, size_t c, size_t s) const { assert((s + c) <= this->V->NumberOfValues); this->GetValuesT(v, c, s); } void vtkDICOMValue::GetValues(int *v, size_t c, size_t s) const { assert((s + c) <= this->V->NumberOfValues); this->GetValuesT(v, c, s); } void vtkDICOMValue::GetValues(unsigned int *v, size_t c, size_t s) const { assert((s + c) <= this->V->NumberOfValues); this->GetValuesT(v, c, s); } void vtkDICOMValue::GetValues(float *v, size_t c, size_t s) const { assert((s + c) <= this->V->NumberOfValues); this->GetValuesT(v, c, s); } void vtkDICOMValue::GetValues(double *v, size_t c, size_t s) const { assert((s + c) <= this->V->NumberOfValues); this->GetValuesT(v, c, s); } void vtkDICOMValue::GetValues(std::string *v, size_t c, size_t s) const { assert((s + c) <= this->V->NumberOfValues); this->GetValuesT(v, c, s); } void vtkDICOMValue::GetValues(vtkDICOMTag *v, size_t c, size_t s) const { assert((s + c) <= this->V->NumberOfValues); this->GetValuesT(v, c, s); } //---------------------------------------------------------------------------- unsigned char vtkDICOMValue::GetUnsignedChar(size_t i) const { unsigned char v = 0; if (this->V && i < this->V->NumberOfValues) { this->GetValuesT(&v, 1, i); } return v; } short vtkDICOMValue::GetShort(size_t i) const { short v = 0; if (this->V && i < this->V->NumberOfValues) { this->GetValuesT(&v, 1, i); } return v; } unsigned short vtkDICOMValue::GetUnsignedShort(size_t i) const { unsigned short v = 0; if (this->V && i < this->V->NumberOfValues) { this->GetValuesT(&v, 1, i); } return v; } int vtkDICOMValue::GetInt(size_t i) const { int v = 0; if (this->V && i < this->V->NumberOfValues) { this->GetValuesT(&v, 1, i); } return v; } unsigned int vtkDICOMValue::GetUnsignedInt(size_t i) const { unsigned int v = 0; if (this->V && i < this->V->NumberOfValues) { this->GetValuesT(&v, 1, i); } return v; } float vtkDICOMValue::GetFloat(size_t i) const { float v = 0.0; if (this->V && i < this->V->NumberOfValues) { this->GetValuesT(&v, 1, i); } return v; } double vtkDICOMValue::GetDouble(size_t i) const { double v = 0.0; if (this->V && i < this->V->NumberOfValues) { this->GetValuesT(&v, 1, i); } return v; } std::string vtkDICOMValue::GetUTF8String(size_t i) const { if (this->V && this->V->CharacterSet != 0) { if (this->V && i < this->V->NumberOfValues) { std::string v; this->AppendValueToUTF8String(v, i); return v; } } return this->GetString(i); } std::string vtkDICOMValue::GetString(size_t i) const { std::string v; if (this->V && i < this->V->NumberOfValues) { this->AppendValueToString(v, i); } return v; } vtkDICOMTag vtkDICOMValue::GetTag(size_t i) const { vtkDICOMTag v; if (this->V && this->V->VR == vtkDICOMVR::AT && i < this->V->NumberOfValues) { this->GetValuesT(&v, 1, i); } return v; } const vtkDICOMItem& vtkDICOMValue::GetItem(size_t i) const { if (this->V && this->V->Type == VTK_DICOM_ITEM && i < this->V->NumberOfValues) { const vtkDICOMItem *ptr = static_cast<const ValueT<vtkDICOMItem> *>(this->V)->Data; return ptr[i]; } return vtkDICOMValue::EmptyItem; } //---------------------------------------------------------------------------- unsigned char vtkDICOMValue::AsUnsignedChar() const { unsigned char v = 0; if (this->V && this->V->NumberOfValues >= 1) { this->GetValuesT(&v, 1, 0); } return v; } short vtkDICOMValue::AsShort() const { short v = 0; if (this->V && this->V->NumberOfValues >= 1) { this->GetValuesT(&v, 1, 0); } return v; } unsigned short vtkDICOMValue::AsUnsignedShort() const { unsigned short v = 0; if (this->V && this->V->NumberOfValues >= 1) { this->GetValuesT(&v, 1, 0); } return v; } int vtkDICOMValue::AsInt() const { int v = 0; if (this->V && this->V->NumberOfValues >= 1) { this->GetValuesT(&v, 1, 0); } return v; } unsigned int vtkDICOMValue::AsUnsignedInt() const { unsigned int v = 0; if (this->V && this->V->NumberOfValues >= 1) { this->GetValuesT(&v, 1, 0); } return v; } float vtkDICOMValue::AsFloat() const { float v = 0.0; if (this->V && this->V->NumberOfValues >= 1) { this->GetValuesT(&v, 1, 0); } return v; } double vtkDICOMValue::AsDouble() const { double v = 0.0; if (this->V && this->V->NumberOfValues >= 1) { this->GetValuesT(&v, 1, 0); } return v; } std::string vtkDICOMValue::AsUTF8String() const { const char *cp = this->GetCharData(); if (cp) { vtkDICOMCharacterSet cs(this->V->CharacterSet); size_t l = this->V->VL; while (l > 0 && cp[l-1] == '\0') { l--; } if (this->V->VR.HasSingleValue()) { while (l > 0 && cp[l-1] == ' ') { l--; } return cs.ConvertToUTF8(cp, l); } else { // convert each value separately const char *ep = cp + l; std::string s; while (cp != ep && *cp != '\0') { size_t n = cs.NextBackslash(cp, ep); while (n > 0 && *cp == ' ') { cp++; n--; } size_t m = n; while (m > 0 && cp[m-1] == ' ') { m--; } s.append(cs.ConvertToUTF8(cp, m)); cp += n; if (cp != ep && *cp == '\\') { s.append(cp, 1); cp++; } } return s; } } return vtkDICOMValue::AsString(); } std::string vtkDICOMValue::AsString() const { const char *cp = this->GetCharData(); if (cp) { size_t l = this->V->VL; while (l > 0 && cp[l-1] == '\0') { l--; } if (this->V->VR.HasSingleValue()) { while (l > 0 && cp[l-1] == ' ') { l--; } return std::string(cp, l); } else { // convert each value separately vtkDICOMCharacterSet cs(this->V->CharacterSet); const char *ep = cp + l; std::string s; while (cp != ep && *cp != '\0') { size_t n = cs.NextBackslash(cp, ep); while (n > 0 && *cp == ' ') { cp++; n--; } size_t m = n; while (m > 0 && cp[m-1] == ' ') { m--; } s.append(cp, m); cp += n; if (cp != ep && *cp == '\\') { s.append(cp, 1); cp++; } } return s; } } std::string v; if (this->V && this->V->VR != vtkDICOMVR::UN && this->V->VR != vtkDICOMVR::SQ && this->V->VR != vtkDICOMVR::OW && this->V->VR != vtkDICOMVR::OB && this->V->VR != vtkDICOMVR::OF && this->V->VR != vtkDICOMVR::OD) { size_t n = this->V->NumberOfValues; for (size_t i = 0; i < n; i++) { if (i > 0) { v.append("\\"); } this->AppendValueToString(v, i); } } return v; } vtkDICOMTag vtkDICOMValue::AsTag() const { vtkDICOMTag v; if (this->V && this->V->VR == vtkDICOMVR::AT && this->V->NumberOfValues >= 1) { this->GetValuesT(&v, 1, 0); } return v; } const vtkDICOMItem& vtkDICOMValue::AsItem() const { return this->GetItem(0); } //---------------------------------------------------------------------------- // Get one of the backslash-separated substrings, requires a text value. void vtkDICOMValue::Substring( size_t i, const char *&start, const char *&end) const { const char *cp = static_cast<const ValueT<char> *>(this->V)->Data; const char *ep = cp + this->V->VL; const char *dp = ep; if (this->V->NumberOfValues > 1 && ++i > 0) { if (this->V->CharacterSet == 0) { dp = cp - 1; do { cp = dp + 1; do { dp++; } while (*dp != '\\' && dp != ep); } while (--i != 0 && dp != ep); } else { vtkDICOMCharacterSet cs(this->V->CharacterSet); for (;;) { dp = cp + cs.NextBackslash(cp, ep); if (--i == 0 || *dp != '\\') { break; } cp = dp + 1; } } } // remove any spaces used as padding if (!this->V->VR.HasSingleValue()) { while (cp != dp && cp[0] == ' ') { cp++; } } while (cp != dp && dp[-1] == ' ') { dp--; } start = cp; end = dp; } //---------------------------------------------------------------------------- void vtkDICOMValue::AppendValueToUTF8String( std::string& str, size_t i) const { if (this->V && this->V->Type == VTK_CHAR && this->V->CharacterSet != 0) { const char *cp = static_cast<const ValueT<char> *>(this->V)->Data; const char *dp = cp + (i == 0 ? this->V->VL : 0); if (!this->V->VR.HasSingleValue()) { this->Substring(i, cp, dp); } vtkDICOMCharacterSet cs(this->V->CharacterSet); str += cs.ConvertToUTF8(cp, dp-cp); } else { this->AppendValueToString(str, i); } } //---------------------------------------------------------------------------- // Convert one value to text and add it to the supplied string void vtkDICOMValue::AppendValueToString( std::string& str, size_t i) const { const char *cp = 0; const char *dp = 0; double f = 0.0; int d = 0; size_t u = 0; vtkDICOMTag a; if (this->V == 0) { return; } assert(i < this->V->NumberOfValues); switch (this->V->Type) { case VTK_CHAR: cp = static_cast<const ValueT<char> *>(this->V)->Data; dp = cp + (i == 0 ? this->V->VL : 0); if (this->V->VR.HasSingleValue()) { // strip trailing spaces while (dp != cp && dp[-1] == ' ') { --dp; } } else { // get just one of the values, strip leading & trailing spaces this->Substring(i, cp, dp); } break; case VTK_UNSIGNED_CHAR: d = static_cast<const ValueT<unsigned char> *>(this->V)->Data[i]; break; case VTK_SHORT: d = static_cast<const ValueT<short> *>(this->V)->Data[i]; break; case VTK_UNSIGNED_SHORT: d = static_cast<const ValueT<unsigned short> *>(this->V)->Data[i]; break; case VTK_INT: d = static_cast<const ValueT<int> *>(this->V)->Data[i]; break; case VTK_UNSIGNED_INT: u = static_cast<const ValueT<unsigned int> *>(this->V)->Data[i]; break; case VTK_FLOAT: f = static_cast<const ValueT<float> *>(this->V)->Data[i]; break; case VTK_DOUBLE: f = static_cast<const ValueT<double> *>(this->V)->Data[i]; break; case VTK_DICOM_TAG: a = static_cast<const ValueT<vtkDICOMTag> *>(this->V)->Data[i]; break; } if (this->V->Type == VTK_CHAR) { while (cp != dp && dp[-1] == '\0') { --dp; } str.append(cp, dp); } else if (this->V->Type == VTK_FLOAT || this->V->Type == VTK_DOUBLE) { // force consistent printing of "inf", "nan" regardless of platform if (vtkMath::IsNan(f)) { str.append("nan"); } else if (vtkMath::IsInf(f)) { str.append((f < 0) ? "-inf" : "inf"); } else { char text[32]; // guard against printing non-significant digits: // use exponential form if printing in "%f" format // would print an integer that is too large for the // float to accurately represent. if ((this->V->Type == VTK_DOUBLE && fabs(f) <= 9007199254740992.0) || // 2^53 (this->V->Type == VTK_FLOAT && fabs(f) <= 16777216.0)) // 2^24 { if (this->V->Type == VTK_DOUBLE) { sprintf(text, "%#.16g", f); } else { sprintf(text, "%#.8g", f); } // make sure there is a zero after the decimal point size_t l = strlen(text); if (l > 0 && text[l-1] == '.') { text[l++] = '0'; text[l] = '\0'; } } else { if (this->V->Type == VTK_DOUBLE) { sprintf(text, "%.15e", f); } else { sprintf(text, "%.7e", f); } } // trim trailing zeros, except the one following decimal point size_t ti = 0; while (text[ti] != '\0' && text[ti] != 'e') { ti++; } size_t tj = ti; while (tj > 1 && text[tj-1] == '0' && text[tj-2] != '.') { tj--; } while (text[ti] != '\0') { text[tj++] = text[ti++]; } // if exponent has three digits, clear the first if it is zero if (tj >= 5 && text[tj-5] == 'e' && text[tj-3] == '0') { text[tj-3] = text[tj-2]; text[tj-2] = text[tj-1]; tj--; } text[tj] = '\0'; str.append(text); } } else if (this->V->Type == VTK_UNSIGNED_CHAR || this->V->Type == VTK_SHORT || this->V->Type == VTK_UNSIGNED_SHORT || this->V->Type == VTK_INT || this->V->Type == VTK_UNSIGNED_INT) { // simple code to convert an integer to a string char text[16]; size_t ti = 16; // if d is nonzero, set u to abs(d) if (d > 0) { u = d; } if (d < 0) { u = -d; } // convert u to a string do { text[--ti] = '0' + static_cast<char>(u % 10); u /= 10; } while (u != 0); // add sign if (d < 0) { text[--ti] = '-'; } str.append(&text[ti], &text[16]); } else if (this->V->Type == VTK_DICOM_TAG) { char text[12]; int t[2]; t[0] = a.GetGroup(); t[1] = a.GetElement(); char *tp = text; *tp++ = '('; for (int j = 0; j < 2; j++) { for (int k = 12; k >= 0; k -= 4) { char c = ((t[j] >> k) & 0x000F); *tp++ = (c < 10 ? '0' + c : 'A' - 10 + c); } *tp++ = ','; } tp[-1] = ')'; *tp = '\0'; str.append(text, &text[11]); } } //---------------------------------------------------------------------------- // These compare functions can only be safely used within "operator==" // and "Matches()" because they require a pre-check that VL matches // and that a, b are the correct type. template<class T> bool vtkDICOMValue::ValueT<T>::Compare(const Value *a, const Value *b) { bool r = (a->VL == b->VL); size_t n = a->VL/sizeof(T); if (n != 0 && r) { const T *ap = static_cast<const ValueT<T> *>(a)->Data; const T *bp = static_cast<const ValueT<T> *>(b)->Data; do { r &= (*ap++ == *bp++); } while (r && --n); } return r; } template<> bool vtkDICOMValue::ValueT<char>::Compare( const Value *a, const Value *b) { bool r = (a->VL == b->VL); r &= (a->CharacterSet == b->CharacterSet); size_t n = a->VL; if (n != 0 && r) { const unsigned char *ap = static_cast<const ValueT<unsigned char> *>(a)->Data; const unsigned char *bp = static_cast<const ValueT<unsigned char> *>(b)->Data; do { r &= (*ap++ == *bp++); } while (r && --n); } return r; } template<> bool vtkDICOMValue::ValueT<unsigned char>::Compare( const Value *a, const Value *b) { bool r = (a->VL == b->VL); size_t n = a->VL; if (a->VL == 0xFFFFFFFF) { n = a->NumberOfValues; r &= (n == b->NumberOfValues); #ifdef VTK_DICOM_USE_OVERFLOW_BYTE n += (static_cast<size_t>(a->Overflow) << 32); r &= (a->Overflow == b->Overflow); #endif } if (n != 0 && r) { const unsigned char *ap = static_cast<const ValueT<unsigned char> *>(a)->Data; const unsigned char *bp = static_cast<const ValueT<unsigned char> *>(b)->Data; do { r &= (*ap++ == *bp++); } while (r && --n); } return r; } template<> bool vtkDICOMValue::ValueT<vtkDICOMItem>::Compare( const Value *a, const Value *b) { size_t n = a->NumberOfValues; // do not use VL/sizeof() bool r = (n == b->NumberOfValues); if (n != 0 && r) { const vtkDICOMItem *ap = static_cast<const ValueT<vtkDICOMItem> *>(a)->Data; const vtkDICOMItem *bp = static_cast<const ValueT<vtkDICOMItem> *>(b)->Data; do { r &= (*ap++ == *bp++); } while (r && --n); } return r; } template<> bool vtkDICOMValue::ValueT<vtkDICOMValue>::Compare( const Value *a, const Value *b) { size_t n = a->NumberOfValues; // do not use VL/sizeof() bool r = (n == b->NumberOfValues); if (n != 0 && r) { const vtkDICOMValue *ap = static_cast<const ValueT<vtkDICOMValue> *>(a)->Data; const vtkDICOMValue *bp = static_cast<const ValueT<vtkDICOMValue> *>(b)->Data; do { r &= (*ap++ == *bp++); } while (r && --n); } return r; } //---------------------------------------------------------------------------- // This CompareEach template is more limited than the Compare template: // it can only be used for SS, US, SL, UL, FL, FD. Its purpose it to // support the Matches() method, and it shouldn't be used anywhere else. template<class T> bool vtkDICOMValue::ValueT<T>::CompareEach(const Value *a, const Value *b) { bool r = true; if (a->NumberOfValues > 0 && b->NumberOfValues > 0) { size_t n = a->NumberOfValues; size_t mm = b->NumberOfValues; const T *ap = static_cast<const ValueT<T> *>(a)->Data; const T *bbp = static_cast<const ValueT<T> *>(b)->Data; do { size_t m = mm; const T *bp = bbp; do { r = (*ap == *bp); bp++; } while (--m && !r); if (r) { // set new start for inner loop bbp = bp; mm = m; if (mm == 0) { r = (n == 1); break; } } ap++; } while (--n && r); } return r; } //---------------------------------------------------------------------------- bool vtkDICOMValue::PatternMatchesMulti( const char *pattern, const char *val, vtkDICOMVR vr) { bool inclusive = (vr == vtkDICOMVR::UI); bool ordered = (vr == vtkDICOMVR::IS || vr == vtkDICOMVR::DS); bool match = !inclusive; const char *pp = pattern; while (match ^ inclusive) { // get pattern value start and end const char *pd = pp; while (*pd != '\0' && *pd != '\\') { pd++; } const char *pf = pd; // strip spaces while (*pp == ' ') { pp++; } while (pf != pp && pf[-1] == ' ') { --pf; } match = false; const char *vp = val; while (!match) { // get value start and end const char *vd = vp; while (*vd != '\0' && *vd != '\\') { vd++; } const char *vf = vd; // strip whitespace while (*vp == ' ') { vp++; } while (vf != vp && vf[-1] == ' ') { --vf; } match = vtkDICOMUtilities::PatternMatches(pp, pf-pp, vp, vf-vp); // break if no values remain if (*vd == '\0') { break; } vp = vd + 1; } if (match && ordered) { // set inner loop start to current position val = vp; } // break if no patterns remain if (*pd == '\0') { break; } pp = pd + 1; } return match; } //---------------------------------------------------------------------------- bool vtkDICOMValue::PatternMatchesPersonName( const char *pattern, const char *val) { bool match = false; char normalizedPattern[256]; char normalizedName[256]; const char *pp = pattern; while (!match) { // normalize the pattern vtkDICOMValue::NormalizePersonName(pp, normalizedPattern, true); const char *vp = val; while (!match) { // normalize the name vtkDICOMValue::NormalizePersonName(vp, normalizedName); match = vtkDICOMUtilities::PatternMatches( normalizedPattern, strlen(normalizedPattern), normalizedName, strlen(normalizedName)); // break if no values remain while (*vp != '\0' && *vp != '\\') { vp++; } if (*vp == '\0') { break; } vp++; } // break if no patterns remain while (*pp != '\0' && *pp != '\\') { pp++; } if (*pp == '\0') { break; } pp++; } return match; } //---------------------------------------------------------------------------- void vtkDICOMValue::NormalizePersonName( const char *input, char output[256], bool isquery) { // this normalizes a PN so that it consists of three component groups // of five components each const char *cp = input; char *dp = output; // loop over component groups for (int i = 0; i < 3; i++) { // set maximum length of extended component group to 85 bytes // (because 85*3 + 1 == 256, and 85 > 64 where 64 is max for PN) char *groupStart = dp; char *ep = dp + 85; // loop over components for (int j = 0; j < 5; j++) { // save start location char *componentStart = dp; // copy characters while (*cp != '^' && *cp != '=' && *cp != '\\' && *cp != '\0' && dp != ep) { *dp++ = *cp++; } // strip trailing spaces and periods while (dp != componentStart && (dp[-1] == ' ' || dp[-1] == '.')) { --dp; } if (dp != ep) { // if query, replace empty components with wildcard if (isquery && dp == componentStart) { *dp++ = '*'; } // mark end of component if (j != 4) { *dp++ = '^'; } } else if (isquery && dp != componentStart) { // back up by one unicode code point, replace with wildcard do { --dp; } while (dp != componentStart && (*dp & 0xC0) == 0x80); *dp++ = '*'; } // go to next component of input if (*cp == '^') { cp++; } } // collapse repeated wildcards if (isquery) { while (dp - groupStart > 2 && dp[-3] == '*' && dp[-2] == '^' && dp[-1] == '*') { dp -= 2; } } // mark end of component group if (i != 2) { *dp++ = '='; } // go to next component group of input if (*cp == '=') { cp++; } } // collapse repeated wildcards if (isquery) { while (dp - output > 2 && dp[-3] == '*' && dp[-2] == '=' && dp[-1] == '*') { dp -= 2; } } // terminate *dp = '\0'; } //---------------------------------------------------------------------------- size_t vtkDICOMValue::NormalizeDateTime( const char *input, char output[22], vtkDICOMVR vr) { // if the value is DT and has a timezone offset, we ignore it, // because timezone adjustment is only done if it is negotiated // as part of the query, otherwise timezones are ignored // use UNIX epoch as our arbitrary time base static const char epoch[22] = "19700101000000.000000"; for (int i = 0; i < 22; i++) { output[i] = epoch[i]; } char *tp = output; if (vr == vtkDICOMVR::TM) { tp += 8; } const char *cp = input; while (*tp != 0 && *cp >= '0' && *cp <= '9') { *tp++ = *cp++; } if (*tp == '.' && *cp == '.') { *tp++ = *cp++; while (*tp != 0 && *cp >= '0' && *cp <= '9') { *tp++ = *cp++; } } return static_cast<size_t>(tp - output); } //---------------------------------------------------------------------------- bool vtkDICOMValue::Matches(const vtkDICOMValue& value) const { /* Attribute matching: 1) Single Value Matching 2) List of UID Matching (match if any UIDs in query list match) 3) Universal Matching (if query value is empty) 4) Wild Card Matching (with * and ?) 5) Range Matching (range of dates or times) 6) Sequence Matching (match if any items in sequence match) Notes: - Encoded strings should be converted to UTF8 - PN matches should be case-insensitive, ideally normalized - All other queries are case-sensitive - List can be used for more than just UIDs - Numeric value comparisons can be templated */ // keys with no value match (universal matching) if (value.V == 0) { return true; } if (value.V->Type != VTK_DICOM_ITEM) { // for everything but sequences, check if the length is zero if (value.V->VL == 0) { return true; } } else if (value.GetNumberOfValues() == 0 || static_cast<const ValueT<vtkDICOMItem> *>(value.V)->Data ->GetNumberOfDataElements() == 0) { // empty sequences match return true; } if (this->V == 0 || this->V->VR != value.V->VR) { // match is impossible if VRs differ return false; } bool match = false; vtkDICOMVR vr = this->V->VR; int type = this->V->Type; // First, do comparisons for string values if (type == VTK_CHAR) { // Does the pattern string have wildcards? bool wildcard = false; const char *pattern = static_cast<const ValueT<char> *>(value.V)->Data; size_t pl = 0; while (pattern[pl] != '\0' && pl < value.V->VL) { char c = pattern[pl++]; wildcard |= (c == '*'); wildcard |= (c == '?'); } while (pl > 0 && pattern[pl-1] == ' ') { pl--; } // Get string value and remove any trailing nulls and spaces const char *cp = static_cast<const ValueT<char> *>(this->V)->Data; size_t l = this->V->VL; while (l > 0 && cp[l-1] == '\0') { l--; } while (l > 0 && cp[l-1] == ' ') { l--; } if (!wildcard && (vr == vtkDICOMVR::DA || vr == vtkDICOMVR::TM || vr == vtkDICOMVR::DT)) { // Find the position of the hyphen size_t hp = 0; while (hp < pl && pattern[hp] != '-') { hp++; } if (vr == vtkDICOMVR::DT && hp + 5 < pl) { // Check if the hyphen was part of the timezone offset if (pattern[hp+5] == '-') { hp += 5; } else if (hp != 4 && pattern[hp+5] == '\0') { hp = 0; } } // Get a pointer to the part of pattern after the hyphen const char *dp = &pattern[hp]; bool hyphen = (*dp == '-'); dp += hyphen; // Normalize the dates/times and compare char r1[22], r2[22], d[22]; size_t n1 = 0; size_t n2 = 0; vtkDICOMValue::NormalizeDateTime(cp, d, vr); r1[0] = '\0'; if (pattern[0] != '\0' && pattern[0] != '-') { n1 = vtkDICOMValue::NormalizeDateTime(pattern, r1, vr); } r2[0] = '\0'; if (dp[0] != '\0' && dp[0] != '-') { n2 = vtkDICOMValue::NormalizeDateTime(dp, r2, vr); } // Perform lexical comparison on normalized datetime if (!hyphen) { match = (strncmp(d, r1, n1) == 0); } else if (*r1 != '\0') { match = (strncmp(d, r1, n1) >= 0); } else if (*r2 != '\0') { match = (strncmp(r2, d, n2) >= 0); } else { match = (strncmp(r2, d, n2) >= 0 && strncmp(d, r1, n1) >= 0); } } else { // Perform wildcard matching and list matching std::string str; std::string pstr; if (vr == vtkDICOMVR::PN) { // Convert to lowercase UTF8 before matching vtkDICOMCharacterSet cs = this->GetCharacterSet(); const char *ep = cp + l; while (cp != ep && *cp != '\0') { size_t n = cs.NextBackslash(cp, ep); str.append(cs.CaseFoldedUTF8(cp, n)); cp += n; if (cp != ep && *cp == '\\') { str.append(cp, 1); cp++; } } cp = str.c_str(); l = str.length(); pstr = value.GetCharacterSet().CaseFoldedUTF8(pattern, pl); pattern = pstr.c_str(); pl = pstr.length(); } else if (vr.HasSpecificCharacterSet()) { if (this->V->CharacterSet != vtkDICOMCharacterSet::ISO_IR_6 && this->V->CharacterSet != vtkDICOMCharacterSet::ISO_IR_192) { // Convert value to UTF8 before matching str = this->AsUTF8String(); cp = str.c_str(); l = str.length(); } if (value.V->CharacterSet != vtkDICOMCharacterSet::ISO_IR_6 && value.V->CharacterSet != vtkDICOMCharacterSet::ISO_IR_192) { // Convert pattern to UTF8 before matching pstr = value.AsUTF8String(); pattern = pstr.c_str(); pl = pstr.length(); } } if (vr == vtkDICOMVR::PN) { match = vtkDICOMValue::PatternMatchesPersonName(pattern, cp); } else if (vr.HasSingleValue()) { match = vtkDICOMUtilities::PatternMatches(pattern, pl, cp, l); } else { match = vtkDICOMValue::PatternMatchesMulti(pattern, cp, vr); } } } else if (type == VTK_DICOM_VALUE) { // Match if any of the contained values match vtkDICOMValue *vp = static_cast<ValueT<vtkDICOMValue> *>(this->V)->Data; size_t vn = this->GetNumberOfValues(); for (size_t i = 0; i < vn && !match; i++) { match = vp->Matches(value); vp++; } } else if (type == VTK_DICOM_ITEM) { // Match if any item matches vtkDICOMItem *item = static_cast<ValueT<vtkDICOMItem> *>(value.V)->Data; vtkDICOMItem *ip = static_cast<ValueT<vtkDICOMItem> *>(this->V)->Data; size_t n = this->GetNumberOfValues(); for (size_t i = 0; i < n && !match; i++) { vtkDICOMDataElementIterator iter = item->Begin(); vtkDICOMDataElementIterator iterEnd = item->End(); match = true; while (match && iter != iterEnd) { vtkDICOMTag tag = iter->GetTag(); // The SpecificCharacterSet is always considered to match. Its // presence in the query describes the character encoding of the // query, so that query strings can be converted to utf-8 at the // point of comparison with the data set strings. if (tag != DC::SpecificCharacterSet) { match = ip->GetAttributeValue(tag).Matches(iter->GetValue()); } ++iter; } ip++; } } else if (type == VTK_DICOM_TAG) { // Comparing tags between data sets should just always return "true" match = true; } else if (vr == vtkDICOMVR::OB || vr == vtkDICOMVR::UN) { // OB and UN must match exactly match = ValueT<unsigned char>::Compare(value.V, this->V); } else if (vr == vtkDICOMVR::OW) { // OW must match exactly match = ValueT<short>::Compare(value.V, this->V); } else if (vr == vtkDICOMVR::OF) { // OF must match exactly match = ValueT<float>::Compare(value.V, this->V); } else if (vr == vtkDICOMVR::OD) { // OF must match exactly match = ValueT<double>::Compare(value.V, this->V); } else if (type == VTK_SHORT || type == VTK_UNSIGNED_SHORT) { // Match if any value matches match = ValueT<short>::CompareEach(value.V, this->V); } else if (type == VTK_INT || type == VTK_UNSIGNED_INT) { // Match if any value matches match = ValueT<int>::CompareEach(value.V, this->V); } else if (type == VTK_FLOAT) { // Match if any value matches match = ValueT<float>::CompareEach(value.V, this->V); } else if (type == VTK_DOUBLE) { // Match if any value matches match = ValueT<double>::CompareEach(value.V, this->V); } return match; } //---------------------------------------------------------------------------- bool vtkDICOMValue::Matches(const std::string& value) const { if (value.length() == 0) { // to support universal matching return true; } if (this->V) { if (this->V->VR.HasTextValue()) { return this->Matches(vtkDICOMValue( this->V->VR, this->V->CharacterSet, value)); } else { vtkDICOMValue v(this->V->VR, value); return (v.AsString() == value && this->Matches(v)); } } return false; } //---------------------------------------------------------------------------- bool vtkDICOMValue::Matches(double value) const { if (this->V && this->V->VL > 0 && this->V->VR.HasNumericValue()) { vtkDICOMValue v(this->V->VR, value); return (v.AsDouble() == value && this->Matches(v)); } return false; } //---------------------------------------------------------------------------- bool vtkDICOMValue::operator==(const vtkDICOMValue& o) const { const vtkDICOMValue::Value *a = this->V; const vtkDICOMValue::Value *b = o.V; bool r = true; if (a != b) { r = false; if (a != 0 && b != 0) { if (a->VR == b->VR && a->VL == b->VL && a->Type == b->Type) { r = true; switch (a->Type) { case VTK_CHAR: r = ValueT<char>::Compare(a, b); break; case VTK_UNSIGNED_CHAR: r = ValueT<unsigned char>::Compare(a, b); break; case VTK_SHORT: case VTK_UNSIGNED_SHORT: r = ValueT<short>::Compare(a, b); break; case VTK_INT: case VTK_UNSIGNED_INT: r = ValueT<int>::Compare(a, b); break; case VTK_FLOAT: r = ValueT<float>::Compare(a, b); break; case VTK_DOUBLE: r = ValueT<double>::Compare(a, b); break; case VTK_DICOM_ITEM: r = ValueT<vtkDICOMItem>::Compare(a, b); break; case VTK_DICOM_VALUE: r = ValueT<vtkDICOMValue>::Compare(a, b); break; } } } } return r; } //---------------------------------------------------------------------------- ostream& operator<<(ostream& os, const vtkDICOMValue& v) { vtkDICOMVR vr = v.GetVR(); const char *cp = v.GetCharData(); if (!v.IsValid()) { os << "empty[0]"; } else if (vr == vtkDICOMVR::UN) { os << "unknown[" << v.GetNumberOfValues() << "]"; } else if (vr == vtkDICOMVR::ST || vr == vtkDICOMVR::LT || vr == vtkDICOMVR::UT) { // might have control characters, don't print it os << "text[" << v.GetVL() << "]"; } else if (cp) { const char *dp = cp + v.GetVL(); while (cp != dp && *cp == ' ') { cp++; } while (cp != dp && dp[-1] == ' ') { dp--; } if (cp != dp) { if (dp[-1] == '\0' || *dp == '\0') { os << cp; } else { std::string s = std::string(cp, dp); os << s.c_str(); } } } else if (vr == vtkDICOMVR::AT) { const vtkDICOMTag *tp = v.GetTagData(); size_t m = v.GetNumberOfValues(); if (tp) { for (size_t j = 0; j < m; j++) { if (j > 0) { os << ","; } os << tp[j]; } } else { os << "tags[" << m << "]"; } } else if (vr == vtkDICOMVR::SQ) { os << "items[" << v.GetNumberOfValues() << "]"; } else if (vr == vtkDICOMVR::OB) { os << "bytes[" << v.GetNumberOfValues() << "]"; } else if (vr == vtkDICOMVR::OW) { os << "words[" << v.GetNumberOfValues() << "]"; } else if (vr == vtkDICOMVR::OF) { os << "floats[" << v.GetNumberOfValues() << "]"; } else if (vr == vtkDICOMVR::OD) { os << "doubles[" << v.GetNumberOfValues() << "]"; } else { const vtkDICOMValue *vp = v.GetMultiplexData(); if (vp) { // value is a multiplex of per-instance values os << "values[" << v.GetNumberOfValues() << "]"; } else { std::string s; size_t m = v.GetNumberOfValues(); size_t n = (m <= 16 ? m : 16); for (size_t i = 0; i < n; i++) { s.append((i == 0 ? "" : ",")); v.AppendValueToUTF8String(s, i); } if (m > n) { s.append(",..."); } os << s.c_str(); } } return os; }
[ "david.gobbi@gmail.com" ]
david.gobbi@gmail.com
51700dc0cc9cf6be6ee9ce780802089eb47cd616
f6ab96101246c8764dc16073cbea72a188a0dc1a
/volume114/11423 - Cache Simulator.cpp
d6d92dbfbf923b24b7de26799ed968563f49030f
[]
no_license
nealwu/UVa
c87ddc8a0bf07a9bd9cadbf88b7389790bc321cb
10ddd83a00271b0c9c259506aa17d03075850f60
refs/heads/master
2020-09-07T18:52:19.352699
2019-05-01T09:41:55
2019-05-01T09:41:55
220,883,015
3
2
null
2019-11-11T02:14:54
2019-11-11T02:14:54
null
UTF-8
C++
false
false
1,579
cpp
#include <bits/stdc++.h> using namespace std; const int MAXT = (1e+7) + 5; struct BIT { int tree[MAXT], n; void init(int n) { this->n = n; memset(tree, 0, sizeof(tree[0])*n); } void add(int x, int val) { for (; x < n; x += x&(-x)) tree[x] += val; } int query(int x) { int ret = 0; for (; x; x -= x&(-x)) ret += tree[x]; return ret; } int query(int l, int r) { return query(r) - query(l-1); } } tree; static const int MAXN = 32; static const int MAXM = 1<<24; static int n, miss[MAXN], cache[MAXN]; static int stamp[MAXM], mtime; void access(int addr) { int &st = stamp[addr]; if (st == 0) { for (int i = 0; i < n; i++) miss[i]++; } else { int cnt = tree.query(st, mtime); for (int i = 0; i < n && cnt > cache[i]; i++) miss[i]++; tree.add(st, -1); } st = ++mtime; tree.add(st, 1); } int main() { static char cmd[8]; while (scanf("%d", &n) == 1) { for (int i = 0; i < n; i++) scanf("%d", &cache[i]); memset(stamp, 0, sizeof(stamp)); mtime = 0; tree.init(MAXT); int addr, b, y, k; while (scanf("%s", cmd) == 1 && cmd[0] != 'E') { if (cmd[0] == 'A') { scanf("%d", &addr); access(addr); } else if (cmd[0] == 'R') { scanf("%d %d %d", &b, &y, &k); for (int i = 0; i < k; i++) access(b+y*i); } else { for (int i = 0; i < n; i++) printf("%d%c", miss[i], " \n"[i==n-1]); memset(miss, 0, sizeof(miss[0])*n); } } } return 0; } /* 2 4 8 RANGE 1 1 5 RANGE 2 1 2 ADDR 99 STAT ADDR 2 RANGE 5 -1 2 STAT RANGE 0 10000 10 RANGE 0 20000 5 RANGE 0 30000 4 STAT END */
[ "morris821028@gmail.com" ]
morris821028@gmail.com
60e7577eaab31810fde38335b1080da0a45070dc
da72f9635d75e60e6245af1f6cf0d41c63e209fd
/back_tracking/113_path_sum_ii.cpp
e56aba3038e14344e1502893bca7f1218a308c24
[]
no_license
yiliu061/leetcode
b7165101f7d9ea7e2b605dbc50302cd7feae959d
8c4c3eb73257bfcec1b56ca90b966fdda77f0992
refs/heads/master
2020-09-09T08:12:47.210200
2020-01-04T06:45:17
2020-01-04T06:45:17
221,396,099
0
0
null
null
null
null
UTF-8
C++
false
false
672
cpp
//backtracking //! node-> val can be negative class Solution { public: vector<vector<int>> pathSum(TreeNode* root, int sum) { vector<vector<int>> res; vector<int> curr; explore(root, sum, curr, res); return res; } private: void explore(TreeNode* root, int sum, vector<int> curr, vector<vector<int>>& res){ if (!root) return; curr.push_back(root->val); if (sum == root->val && !root->left && !root->right) res.push_back(curr); explore(root->left, sum - root->val, curr, res); explore(root->right, sum - root->val, curr, res); curr.pop_back(); } };
[ "noreply@github.com" ]
noreply@github.com
e826ef77761f8b88ce35679427a63472a06afecd
0c397eba834d7000f3fe20a500b46742d0f77b22
/docs/math/code/pollard-rho/pollard-rho_1.cpp
096b3f1ec92be187c81eb52545f6aafb5f4e9eaa
[ "MIT" ]
permissive
xiaocairush/xiaocairush.github.io
4548ecd7e3eecd13d2380d740d51ef3593658f30
e1a536dd5c0100f1f13835dfc8354fed13ff18e9
refs/heads/master
2023-08-31T12:55:34.427476
2023-07-29T10:37:38
2023-07-29T10:37:38
64,105,374
4
1
MIT
2023-09-11T04:51:21
2016-07-25T05:13:22
HTML
UTF-8
C++
false
false
2,086
cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; int t; long long max_factor, n; long long gcd(long long a, long long b) { if (b == 0) return a; return gcd(b, a % b); } long long quick_pow(long long x, long long p, long long mod) { // 快速幂 long long ans = 1; while (p) { if (p & 1) ans = (__int128)ans * x % mod; x = (__int128)x * x % mod; p >>= 1; } return ans; } bool Miller_Rabin(long long p) { // 判断素数 if (p < 2) return 0; if (p == 2) return 1; if (p == 3) return 1; long long d = p - 1, r = 0; while (!(d & 1)) ++r, d >>= 1; // 将d处理为奇数 for (long long k = 0; k < 10; ++k) { long long a = rand() % (p - 2) + 2; long long x = quick_pow(a, d, p); if (x == 1 || x == p - 1) continue; for (int i = 0; i < r - 1; ++i) { x = (__int128)x * x % p; if (x == p - 1) break; } if (x != p - 1) return 0; } return 1; } long long Pollard_Rho(long long x) { long long s = 0, t = 0; long long c = (long long)rand() % (x - 1) + 1; int step = 0, goal = 1; long long val = 1; for (goal = 1;; goal *= 2, s = t, val = 1) { // 倍增优化 for (step = 1; step <= goal; ++step) { t = ((__int128)t * t + c) % x; val = (__int128)val * abs(t - s) % x; if ((step % 127) == 0) { long long d = gcd(val, x); if (d > 1) return d; } } long long d = gcd(val, x); if (d > 1) return d; } } void fac(long long x) { if (x <= max_factor || x < 2) return; if (Miller_Rabin(x)) { // 如果x为质数 max_factor = max(max_factor, x); // 更新答案 return; } long long p = x; while (p >= x) p = Pollard_Rho(x); // 使用该算法 while ((x % p) == 0) x /= p; fac(x), fac(p); // 继续向下分解x和p } int main() { scanf("%d", &t); while (t--) { srand((unsigned)time(NULL)); max_factor = 0; scanf("%lld", &n); fac(n); if (max_factor == n) // 最大的质因数即自己 printf("Prime\n"); else printf("%lld\n", max_factor); } return 0; }
[ "xiaocairush@gmail.com" ]
xiaocairush@gmail.com
d171ffff128eca176b4c2cbb6fc92e9fd33adf7a
1f013e822124dfe9b4611f1fe08675a23871566e
/home/akielczewska/z2/oce.cpp
d25bf49eceef0b2647df40b35e4a08f154f7c963
[]
no_license
dtraczewski/zpk2014
a1d9a26d25ff174561e3b20c8660901178d827a5
548970bc5a9a02215687cb143d2f3f44307ff252
refs/heads/master
2021-01-21T06:06:32.044028
2015-09-06T12:17:07
2015-09-06T12:17:07
null
0
0
null
null
null
null
UTF-8
C++
false
false
256
cpp
#include <iostream> using namespace std; main(){ int n, x; cin >> n; int t[6] = {0,0,0,0,0,0}; for (int i = 1; i <= n; i++) { cin >> x; t[x-1]++; } for (int j = 0; j < 6; j++) { cout << t[j] << " "; } }
[ "aneta.kielczewska@student.uw.edu.pl" ]
aneta.kielczewska@student.uw.edu.pl
845e75ad2bde25be63cec2725b2391b074633132
bd51f6ee89b5023c7c454bce6151ccfdfd6f4f81
/lecture4/zero.cc
2c02b3b2df25031be9568fc4feef9a6ea770cdb2
[]
no_license
leoncwu/cpp_basics
b353af74082e4ea76b6b576b58af21a58f717d20
55cc47ca032ff63d9ddc59eff64c1ddd48f453f3
refs/heads/master
2020-04-10T01:30:38.921278
2019-06-20T01:13:58
2019-06-20T01:13:58
160,717,918
0
0
null
null
null
null
UTF-8
C++
false
false
287
cc
#include <iostream> using std::cout; using std::endl; int main(){ double a; a = 1.0/3.0; cout << "Hello world!" << endl ; cout << "Hello world!" << endl ; // cout << "One third is" << endl ; cout << a << endl; cout << "One third is " << a << endl; return 0; }
[ "chunlin5@isp02.tacc.utexas.edu" ]
chunlin5@isp02.tacc.utexas.edu
610e2770aa364f9a68880c919a7205983e8c1063
109852f7d33cb52294167bd57351f6cc2c146f8b
/SetWorldTransform()_demo/rotateDrawDlg.h
7020aa1de033223128446c39e8c2abcad375e40f
[]
no_license
IvanovRoman/graph
41451245a525d9dd3634689a1c527c6a5eaf4014
4ce6c1086355613aecf5d65fefb260d0bbb03c19
refs/heads/master
2021-07-24T21:48:27.416401
2017-11-02T17:20:26
2017-11-02T17:20:26
104,109,439
0
0
null
null
null
null
UTF-8
C++
false
false
1,394
h
// rotateDrawDlg.h : header file // #if !defined(AFX_ROTATEDRAWDLG_H__683BCE9A_3BCC_41FD_AA7D_7A806034042E__INCLUDED_) #define AFX_ROTATEDRAWDLG_H__683BCE9A_3BCC_41FD_AA7D_7A806034042E__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 ///////////////////////////////////////////////////////////////////////////// // CRotateDrawDlg dialog class CRotateDrawDlg : public CDialog { // Construction public: CRotateDrawDlg(CWnd* pParent = NULL); // standard constructor // Dialog Data //{{AFX_DATA(CRotateDrawDlg) enum { IDD = IDD_ROTATEDRAW_DIALOG }; CButton m_ctlDrawArea; int m_iShapeType; int m_iAngle; //}}AFX_DATA // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CRotateDrawDlg) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL // Implementation protected: HICON m_hIcon; // Generated message map functions //{{AFX_MSG(CRotateDrawDlg) virtual BOOL OnInitDialog(); afx_msg void OnSysCommand(UINT nID, LPARAM lParam); afx_msg void OnPaint(); afx_msg HCURSOR OnQueryDragIcon(); virtual void OnOK(); afx_msg void OnBtnUpdate(); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_ROTATEDRAWDLG_H__683BCE9A_3BCC_41FD_AA7D_7A806034042E__INCLUDED_)
[ "werert87@mail.ru" ]
werert87@mail.ru
ab2de55177efaac947950e98df06feb8391c9590
a5d35f7adb05489c16579d987c3d8da1fa0e7920
/Euler/q052.cpp
7e06c6eca0af91480e9a2f354459d5bf5dc64e22
[]
no_license
rajdosi/Codes
56cfcc7d73bce0399e34ef171210a05ae34a2724
9cf9bdd58bc6239d5096f18040c7df0b4cbf50ae
refs/heads/master
2022-01-09T23:35:17.571544
2022-01-08T11:58:49
2022-01-08T11:58:49
70,044,918
0
0
null
null
null
null
UTF-8
C++
false
false
635
cpp
# include <bits/stdc++.h> using namespace std; bool isperm(long long num1,long long num2) { int a1[10]={0},a2[10]={0}; while (num1) { a1[num1%10]++; a2[num2%10]++; num1/=10; num2/=10; } for (int i=0;i<10;i++) { if (a1[i]!=a2[i]) return false; } return true; } int main() { bool NF=true; long long num=1; while(NF) { num=num*10; for (long long i=num;i<(num*10)/6+1;i++) { int flag=0; for (int j=2;j<7;j++) { if (isperm(i,i*j)==false) { flag=1; break; } } if(flag==0) { NF=false; cout<<i; break; } } } cout<<endl; return 0; }
[ "rajdosi10@gmail.com" ]
rajdosi10@gmail.com
341da9cb02be68bfe9aa91e8cba2e020418565b8
90df5416d79babeee0b028b691328943a430b931
/datastructures/LinkedList/Compare.cpp
0fb9ab99af87b3e0cedcd9e8530cce06576b6e90
[]
no_license
arajhansa/HackerRank
908abf25fb143412ac6b098d8ee4c304f5d56efc
2a3a2db52a353eb7f1d22db05101f44f8276d267
refs/heads/master
2022-02-25T21:03:24.340329
2019-08-08T16:16:46
2019-08-08T16:16:46
106,919,337
0
0
null
2017-11-07T09:47:59
2017-10-14T10:35:57
C++
UTF-8
C++
false
false
291
cpp
int compare(Node *headA, Node *headB){ while(headA && headB){ if(headA->data != headB->data){ return 0; } else { headA = headA->next; headB = headB->next; } } if(headA || headB){ return 0; } return 1; }
[ "rajhansa.advay@gmail.com" ]
rajhansa.advay@gmail.com
50645bb74762e9f989c9e02996602cdd1394bea2
d4b733f2e00b5d0ab103ea0df6341648d95c993b
/src/c-cpp/test/sst/bignum/comparison_operators.cpp
3d974c2c922bca0f3dce160c4091d1453b4b6c15
[ "MIT" ]
permissive
stealthsoftwareinc/sst
ad6117a3d5daf97d947862674336e6938c0bc699
f828f77db0ab27048b3204e10153ee8cfc1b2081
refs/heads/master
2023-04-06T15:21:14.371804
2023-03-24T08:30:48
2023-03-24T08:30:48
302,539,309
1
0
null
null
null
null
UTF-8
C++
false
false
2,458
cpp
// // Copyright (C) 2012-2023 Stealth Software Technologies, Inc. // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or // sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice (including // the next paragraph) shall be included in all copies or // substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. // // SPDX-License-Identifier: MIT // #undef SST_COMPILE_TIME_TESTS #define SST_COMPILE_TIME_TESTS 1 // Include first to test independence. #include <sst/catalog/bignum.hpp> // Include twice to test idempotence. #include <sst/catalog/bignum.hpp> // #include <sst/config.h> #if SST_WITH_OPENSSL_CRYPTO #include <sst/catalog/SST_TEST_BOOL.hpp> #include <sst/catalog/SST_TEST_SHOW.hpp> #include <sst/catalog/test_main.hpp> int main() { return sst::test_main([] { //------------------------------------------------------------------ ; // clang-format may behave weirdly without a statement here. #define F(a, op, b) \ ([&]() { \ SST_TEST_BOOL((a)op(b), SST_TEST_SHOW(a), SST_TEST_SHOW(b)); \ SST_TEST_BOOL((b)op(a), SST_TEST_SHOW(a), SST_TEST_SHOW(b)); \ }()) F(sst::bignum(0), ==, 0); F(sst::bignum(0), !=, 1); F(sst::bignum(1), !=, 0); F(sst::bignum(1), ==, 1); #undef F //------------------------------------------------------------------ }); } #else // !SST_WITH_OPENSSL_CRYPTO #include <sst/catalog/test_skip.hpp> int main() { return sst::test_skip(); } #endif // !SST_WITH_OPENSSL_CRYPTO
[ "sst@stealthsoftwareinc.com" ]
sst@stealthsoftwareinc.com
d2e7cff122b5f675d197bb2c0f8d1a1f9e54c9c9
d36d543ed08cdee85a587c6838a52ba630930c41
/io/string2int.cc
f9baeb3343125e2ee40c2a3c90230480dc831f52
[]
no_license
yaopu/Cplusplus_Optimization
09742eb7bae8c13e20070b83f93327fa465c8f4d
bfefcd454cc13028bab013f968b6f07ec384b2d5
refs/heads/master
2020-07-10T10:54:50.193864
2019-10-09T12:55:08
2019-10-09T12:55:08
204,246,653
0
0
null
null
null
null
UTF-8
C++
false
false
297
cc
#include <iostream> #include <stdio.h> #include <string> using namespace std; int string2int(string ss) { int value; for (int i = 0; i < ss.length(); i++) { value = atoi(&ss[0]); } return value; } int main() { string s; cin >> s; cout << string2int(s) << endl; return 0; }
[ "1417511526@qq.com" ]
1417511526@qq.com
ac02008707c239e71f4a136ae65661e582f6ef26
3324b70597e57ac9f3ccaff859aff40852a513c6
/homework/week10_flocking/src/Boid.cpp
0cbd9a1ff95fd9955b4556a96d4faea4b394ff24
[]
no_license
oherterich/algo2013-owenherterich
0cc8aaa93318d026f627188fd6ba4e1f2cc23c16
0988b2dd821b44fca7216b4ec1eab365836dc381
refs/heads/master
2021-01-21T05:05:47.571780
2013-12-16T21:29:20
2013-12-16T21:29:20
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,277
cpp
// // Boid.cpp // week10_flocking // // Created by Owen Herterich on 11/5/13. // // #include "Boid.h" Boid::Boid() { size = 10.0; c = ofColor(255); center.set( ofGetWindowWidth() / 2, ofGetWindowHeight() / 2 ); centerRadius = 300; damping = ofRandom(0.96, 0.98); maxVel = ofRandom(3.0, 6.0); } void Boid::addForce( ofVec2f frc ) { acc += frc; } void Boid::pullToCenter() { ofVec2f diff = center - pos; if (diff.lengthSquared() > (centerRadius * centerRadius) ) { float pct = diff.lengthSquared() / (centerRadius * centerRadius); addForce( diff.normalized() * pct * 0.01 ); } } void Boid::update() { vel += acc; pos += vel; vel.limit(maxVel); if (vel.lengthSquared() < 1.0) { vel = vel.normalized() * 1.0; } lSide = vel.rotated(-45); rSide = vel.rotated(45); vel *= damping; acc.set(0); } void Boid::draw() { ofSetColor( c ); ofCircle(pos, size); ofSetColor( 255, 0, 0 ); ofLine( pos, pos - vel*10.0); ofSetColor( 0, 255, 0 ); ofLine( pos, (pos - vel*-10.0)); ofSetColor(255,255,0); ofLine(pos, pos + lSide.normalized() * 25); ofLine(pos, pos + rSide.normalized() * 25); }
[ "oherterich@gmail.com" ]
oherterich@gmail.com
025ea63bc6a03f88ef488e7a72efbc53c1c6789a
3de7f52b7d4b4aa4245607cdf9045d9c7d402035
/baekjun/greedyAlgorithm/P11399.cpp
4b52bc306787049f9a6d5715e2ab580bc97f0739
[]
no_license
codePracticeWithC/CodePraWithC-
0b9fc252174776f5fa37ac7df71ca5555094d51c
8859ae886eb876cf4704b4bd581b40f2c2e3b112
refs/heads/master
2020-11-27T17:42:58.631029
2019-12-31T16:25:50
2019-12-31T16:25:50
229,548,883
0
0
null
null
null
null
UTF-8
C++
false
false
470
cpp
#include <stdio.h> #include <algorithm> using namespace std; int main(void){ int n; scanf("%d", &n); int person[1001]; for(int i = 0; i < n; i++){ int time = 0; scanf("%d" , &time); person[i] = time; } sort(person, person + n); int sum = 0 ; for(int i = 0; i < n; i++){ for(int j = 0 ; j <= i; j++){ sum += person[j]; } } printf("%d" ,sum); return 0; }
[ "53043213+gudwnsdl88@users.noreply.github.com" ]
53043213+gudwnsdl88@users.noreply.github.com
3a9e881d0e5d99066465022d9da3c99c6ea32221
abd74c69d1d3d7ecfe57d6f295823c8074c0cdf4
/Language Translation/Using Sockets - Google/TranslateDlg.h
e26a43b7216d027ad4eccb13ad450a535bb28911
[]
no_license
suresh3554/MFC-Windows-Programs
8680b275b2ba2af1837a53a123a3297735433bcc
0e7e2edafb58778a072641c590cb85c500c4c683
refs/heads/master
2021-01-10T03:10:04.586376
2016-01-08T09:30:41
2016-01-08T09:30:41
36,648,878
0
0
null
null
null
null
UTF-8
C++
false
false
1,011
h
// TranslateDlg.h : header file // #pragma once #include "afxwin.h" #include "Translator.h" #include "AboutDlg.h" // CTranslateDlg dialog class CTranslateDlg : public CDialogEx { // Construction CTranslator m_cTranslator; CFont m_font; CFont m_Errorfont; CEdit m_cSourceText; CEdit m_cTranslatedText; CComboBox m_cToLang; public: CTranslateDlg(CWnd* pParent = NULL); // standard constructor ~CTranslateDlg(); // Dialog Data enum { IDD = IDD_TRANSLATE_DIALOG }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support // Implementation protected: HICON m_hIcon; // Generated message map functions virtual BOOL OnInitDialog(); afx_msg void OnSysCommand(UINT nID, LPARAM lParam); afx_msg void OnPaint(); afx_msg HCURSOR OnQueryDragIcon(); DECLARE_MESSAGE_MAP() public: afx_msg void OnBnClickedTranslateBtn(); afx_msg void OnCbnSelchangeToCombo(); CStatic m_cErrorText; afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); };
[ "suresh3554@gmail.com" ]
suresh3554@gmail.com
d37df2c43dea705f261a9f0a308db6e7e91171d1
665d8992518430801c8a93a9cbd81aceb8cd4bdb
/_c_code/pb_dist.cpp
9dd4f0020b5318fd11ebed7f220e7a48ccf058d7
[]
no_license
roujiawen/de_experiments
bd4f661ecf2d8328225cc8314aced088307ad514
ce39783c432edb11125acf7e8546287662d356bf
refs/heads/master
2023-04-06T13:40:13.143664
2021-04-21T14:17:55
2021-04-21T14:17:55
292,096,109
0
0
null
null
null
null
UTF-8
C++
false
false
179
cpp
double pb_dist(double x1, double x2, double size_x) { double x = x2-x1; if (x > size_x/2.){ x -= size_x; } else if (x < -size_x/2.){ x += size_x; } return x; }
[ "wenroujia@gmail.com" ]
wenroujia@gmail.com
9f17187ec6f47efd5780d032e0860f8f60af7ded
9f81d77e028503dcbb6d7d4c0c302391b8fdd50c
/google/cloud/dialogflow_es/internal/session_entity_types_connection_impl.h
36b08f3a4bc7a72d71f568486142027912351675
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
googleapis/google-cloud-cpp
b96a6ee50c972371daa8b8067ddd803de95f54ba
178d6581b499242c52f9150817d91e6c95b773a5
refs/heads/main
2023-08-31T09:30:11.624568
2023-08-31T03:29:11
2023-08-31T03:29:11
111,860,063
450
351
Apache-2.0
2023-09-14T21:52:02
2017-11-24T00:19:31
C++
UTF-8
C++
false
false
3,411
h
// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Generated by the Codegen C++ plugin. // If you make any local changes, they will be lost. // source: google/cloud/dialogflow/v2/session_entity_type.proto #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_SESSION_ENTITY_TYPES_CONNECTION_IMPL_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_SESSION_ENTITY_TYPES_CONNECTION_IMPL_H #include "google/cloud/dialogflow_es/internal/session_entity_types_retry_traits.h" #include "google/cloud/dialogflow_es/internal/session_entity_types_stub.h" #include "google/cloud/dialogflow_es/session_entity_types_connection.h" #include "google/cloud/dialogflow_es/session_entity_types_connection_idempotency_policy.h" #include "google/cloud/dialogflow_es/session_entity_types_options.h" #include "google/cloud/background_threads.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/options.h" #include "google/cloud/status_or.h" #include "google/cloud/stream_range.h" #include "google/cloud/version.h" #include <memory> namespace google { namespace cloud { namespace dialogflow_es_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN class SessionEntityTypesConnectionImpl : public dialogflow_es::SessionEntityTypesConnection { public: ~SessionEntityTypesConnectionImpl() override = default; SessionEntityTypesConnectionImpl( std::unique_ptr<google::cloud::BackgroundThreads> background, std::shared_ptr<dialogflow_es_internal::SessionEntityTypesStub> stub, Options options); Options options() override { return options_; } StreamRange<google::cloud::dialogflow::v2::SessionEntityType> ListSessionEntityTypes( google::cloud::dialogflow::v2::ListSessionEntityTypesRequest request) override; StatusOr<google::cloud::dialogflow::v2::SessionEntityType> GetSessionEntityType( google::cloud::dialogflow::v2::GetSessionEntityTypeRequest const& request) override; StatusOr<google::cloud::dialogflow::v2::SessionEntityType> CreateSessionEntityType( google::cloud::dialogflow::v2::CreateSessionEntityTypeRequest const& request) override; StatusOr<google::cloud::dialogflow::v2::SessionEntityType> UpdateSessionEntityType( google::cloud::dialogflow::v2::UpdateSessionEntityTypeRequest const& request) override; Status DeleteSessionEntityType( google::cloud::dialogflow::v2::DeleteSessionEntityTypeRequest const& request) override; private: std::unique_ptr<google::cloud::BackgroundThreads> background_; std::shared_ptr<dialogflow_es_internal::SessionEntityTypesStub> stub_; Options options_; }; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace dialogflow_es_internal } // namespace cloud } // namespace google #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_DIALOGFLOW_ES_INTERNAL_SESSION_ENTITY_TYPES_CONNECTION_IMPL_H
[ "noreply@github.com" ]
noreply@github.com
3614207b763362b881a56763550381262faea18b
4406c1a4cea905c35ac31ba9ab3ff7988dc612cc
/DerivedClass.cpp
3fcddb3f16c69df99087ea83e4f5c4bf6735b191
[]
no_license
apurbaanik/ItemRecord
7bcf5849bc4d589a4a60f8c10d5b76e53e5ef19b
2c27c0e3e88f51b482fe092987429f2fbea567f3
refs/heads/main
2023-05-12T03:16:55.064510
2021-06-05T02:33:02
2021-06-05T02:33:02
374,003,455
0
0
null
null
null
null
UTF-8
C++
false
false
7,620
cpp
/* Title: Homework 4.2 A library record class with derived classes for books and CDs Author: Anik Barua Version: 1.0 Date: 05-04-2021 Description: This C++ program uses polymorphism. First we create a parent class "ItemRecord" and derive two subclasses called "BookRecord" and "CDRecord". Then from main we create two objects from each subclasses and store them in the ItemRecord pointer array. Then we test different functions like to_string() to test which class function it is calling. It is a example of a run-time polymorphism. */ #include <iostream> #include <string> #include <vector> #include <sstream> using namespace std; /* The ItemRecord class maintains books and other media records for a library. Its attributes are title(string), price(double), rating(character). */ class ItemRecord{ private: string title; double price; char rating; public: //Constructor with parameter (if no parameter gets passed the default values gets assigned). ItemRecord(string x = "placeholder", double y = 0.99, char z = 'D'){ //Checking for invariants if(y > 0){ if((z >= 'A' && z <= 'D')){ title = x; price = y; rating = z; } else { throw invalid_argument("Invalid Rating Letter!"); } } else { throw invalid_argument("Negative Price!"); } } //Getters string getTitle() { return title; } double getPrice(){ return price; } char getRating(){ return rating; } //Overloaded “<<” operator which outputs the title only, implemented as a friend function friend ostream &operator<< (ostream &output, ItemRecord &item){ output << item.title << endl; return output; } //Overloaded “==” operator which only compares the item's rating bool operator== (ItemRecord &item){ if(rating == item.getRating()){ return true; } else { return false; } } //setPrice(double) external function void setPrice(double newPrice); //a pure virtual function, to_string() virtual string to_string() = 0; //a virtual destructor virtual ~ItemRecord(){} }; //setPrice(double) throws a range_error exception with the message “negative price”, if value < 0. inline void ItemRecord::setPrice(double newPrice){ if(newPrice < 0){ throw range_error("Negative Price!"); } else { price = newPrice; } } //BookRecord is a derived class from ItemRecord. class BookRecord: public ItemRecord{ private: int* chPages; //Implemented as a dynamic array of integers in the constructor int sizeChPages; //Size for the pointed dynamic array public: //Constructor with default values including for vector. Calling the parent constructor using subclass initialization list. BookRecord(string x = "placeholder", double y = 0.99, char z = 'D', vector<int> vec = vector<int>()) : ItemRecord(x, y, z){ chPages = new int [vec.size()]; //Pointing to a new dynamic array of integers sizeChPages = vec.size(); //Initializing the size for chPages auto itr = vec.begin(); //Iterator to go through the vector values int i = 0; while(itr != vec.end()){ chPages[i] = *itr; //Filling up the dynamic array with vector values i++; itr++; } } //display's the total # of pages for BookRecord including title, price and rating string to_string(){ string price, totalPage; stringstream ss1, ss2; //To omit the zeros after decimal using string stream ss1 << ItemRecord::getPrice(); price = ss1.str(); int pages = 0; //counter for total number of pages int i = 0; while(i < sizeChPages){ pages = pages + chPages[i]; i++; } ss2 << pages; totalPage = ss2.str(); return "Book[ " + ItemRecord::getTitle() + ", " + price + ", " + ItemRecord::getRating() + ", " + totalPage + " ]"; } //Destructor to release the dynamic array ~BookRecord(){ delete[] chPages; } }; //CdRecord is a derived class from ItemRecord. class CdRecord: public ItemRecord{ private: double* trackTimes; //Implemented as a dynamic array of doubles in the constructor int sizeTrackTimes; //Size for the pointed dynamic array public: //Constructor with default values including for vector. Calling the parent constructor using subclass initialization list. CdRecord(string x = "placeholder", double y = 0.99, char z = 'D', vector<double> vec = vector<double>()) : ItemRecord(x, y, z){ trackTimes = new double [vec.size()]; //Pointing to a new dynamic array of double sizeTrackTimes = vec.size(); //Initializing the sizeTrackTimes auto itr = vec.begin(); //Iterator to go through the vector values int i = 0; while(itr != vec.end()){ trackTimes[i] = *itr; //Filling up the dynamic array with vector values i++; itr++; } } //display's the total play time for CdRecord including title, price and rating string to_string(){ string price, totalTime; stringstream ss1, ss2; //To omit the zeros after decimal using string stream ss1 << ItemRecord::getPrice(); price = ss1.str(); double time = 0; //counter for total minutes int i = 0; while(i < sizeTrackTimes){ time = time + trackTimes[i]; i++; } ss2 << time; totalTime = ss2.str(); //Converting int to string return "CD[ " + ItemRecord::getTitle() + ", " + price + ", " + ItemRecord::getRating() + ", " + totalTime + " ]"; } //Destructor to release the dynamic array ~CdRecord(){ delete[] trackTimes; } }; int main(){ try{ BookRecord book1 ("SampleBook", 10.99, 'A', {2, 20, 30, 40, 30, 20}); CdRecord cd1 ("SampleCD", 14.99, 'B', {4.5, 15.0, 23.5, 4.3, 5.2, 20.3}); //Displaying individual titles by using overloaded << cout << "My book's title is: " << book1; cout << "My CD's title is: " << cd1; //Reducing each item's price by $1, using setPrice() book1.setPrice(book1.getPrice()-1); cd1.setPrice(cd1.getPrice()-1); //Showing whether the two items have the same rating by using overloaded == cout << "Do they have the same rating? "; if(book1 == cd1){ cout << "Yes\n" << endl; } else { cout << "No\n" << endl; } int size = 2; ItemRecord* items[size]; //Array of ItemRecord* to store the two items items[0] = &book1; items[1] = &cd1; cout << "Their details in [title, price, rating, total pages/minutes]:\n"; for(int i = 0; i < size; i++) { cout << items[i]->to_string() << endl; } } catch (invalid_argument arg1){ //invalid argument gets thrown when the rating letter is not between 'A' and 'D'. cout << arg1.what() << endl; } catch (range_error arg2){ //range error gets thrown when negative price gets passed. cout << arg2.what() << endl; } return 0; }
[ "noreply@github.com" ]
noreply@github.com
5494a886517711c2d909f3149d0609bf6a0355a3
f259b2bf1e3d4fe32a119b3c9f0a4954a3753fbf
/opencl/cfd/euler3d.cpp
fd6aebfec6bb1aeace5ec0503a8f10c8328553d8
[]
no_license
alexanderjpowell/rodinia
6f58c1f49cf17636dce67583acdf9c035e89d5d2
18c485be29fe5ee4b11a04c9ad756039086b31a3
refs/heads/master
2021-01-20T17:47:04.991148
2017-05-10T18:10:19
2017-05-10T18:10:19
90,887,268
0
0
null
null
null
null
UTF-8
C++
false
false
17,726
cpp
/******************************************************************** euler3d.cpp : parallelized code of CFD - original code from the AIAA-2009-4001 by Andrew Corrigan, acorriga@gmu.edu - parallelization with OpenCL API has been applied by Jianbin Fang - j.fang@tudelft.nl Delft University of Technology Faculty of Electrical Engineering, Mathematics and Computer Science Department of Software Technology Parallel and Distributed Systems Group on 24/03/2011 ********************************************************************/ #include <iostream> #include <fstream> #include <math.h> #include <stdlib.h> #include "CLHelper.h" /* * Options * */ #define GAMMA 1.4f #define iterations 2000 #ifndef block_length #define block_length 192 #endif #define NDIM 3 #define NNB 4 #define RK 3 // 3rd order RK #define ff_mach 1.2f #define deg_angle_of_attack 0.0f /* * not options */ #if block_length > 128 #warning \ "the kernels may fail too launch on some systems if the block length is too large" #endif #define VAR_DENSITY 0 #define VAR_MOMENTUM 1 #define VAR_DENSITY_ENERGY (VAR_MOMENTUM + NDIM) #define NVAR (VAR_DENSITY_ENERGY + 1) // self-defined user type typedef struct { float x; float y; float z; } float3; /* * Generic functions */ template <typename T> cl_mem alloc(int N) { cl_mem mem_d = _clMalloc(sizeof(T) * N); return mem_d; } template <typename T> void dealloc(cl_mem array) { _clFree(array); } template <typename T> void copy(cl_mem dst, cl_mem src, int N) { _clMemcpyD2D(dst, src, N * sizeof(T)); } template <typename T> void upload(cl_mem dst, T *src, int N) { _clMemcpyH2D(dst, src, N * sizeof(T)); } template <typename T> void download(T *dst, cl_mem src, int N) { _clMemcpyD2H(dst, src, N * sizeof(T)); } void dump(cl_mem variables, int nel, int nelr) { float *h_variables = new float[nelr * NVAR]; download(h_variables, variables, nelr * NVAR); { std::ofstream file("density"); file << nel << std::endl; for (int i = 0; i < nel; i++) file << h_variables[i + VAR_DENSITY * nelr] << std::endl; } { std::ofstream file("momentum"); file << nel << std::endl; for (int i = 0; i < nel; i++) { for (int j = 0; j != NDIM; j++) file << h_variables[i + (VAR_MOMENTUM + j) * nelr] << " "; file << std::endl; } } { std::ofstream file("density_energy"); file << nel << std::endl; for (int i = 0; i < nel; i++) file << h_variables[i + VAR_DENSITY_ENERGY * nelr] << std::endl; } delete[] h_variables; } void initialize_variables(int nelr, cl_mem variables, cl_mem ff_variable) throw(string) { int work_items = nelr; int work_group_size = BLOCK_SIZE_1; int kernel_id = 1; int arg_idx = 0; _clSetArgs(kernel_id, arg_idx++, variables); _clSetArgs(kernel_id, arg_idx++, ff_variable); _clSetArgs(kernel_id, arg_idx++, &nelr, sizeof(int)); _clInvokeKernel(kernel_id, work_items, work_group_size); } void compute_step_factor(int nelr, cl_mem variables, cl_mem areas, cl_mem step_factors) { int work_items = nelr; int work_group_size = BLOCK_SIZE_2; int kernel_id = 2; int arg_idx = 0; _clSetArgs(kernel_id, arg_idx++, variables); _clSetArgs(kernel_id, arg_idx++, areas); _clSetArgs(kernel_id, arg_idx++, step_factors); _clSetArgs(kernel_id, arg_idx++, &nelr, sizeof(int)); _clInvokeKernel(kernel_id, work_items, work_group_size); } void compute_flux(int nelr, cl_mem elements_surrounding_elements, cl_mem normals, cl_mem variables, cl_mem ff_variable, cl_mem fluxes, cl_mem ff_flux_contribution_density_energy, cl_mem ff_flux_contribution_momentum_x, cl_mem ff_flux_contribution_momentum_y, cl_mem ff_flux_contribution_momentum_z) { int work_items = nelr; int work_group_size = BLOCK_SIZE_3; int kernel_id = 3; int arg_idx = 0; _clSetArgs(kernel_id, arg_idx++, elements_surrounding_elements); _clSetArgs(kernel_id, arg_idx++, normals); _clSetArgs(kernel_id, arg_idx++, variables); _clSetArgs(kernel_id, arg_idx++, ff_variable); _clSetArgs(kernel_id, arg_idx++, fluxes); _clSetArgs(kernel_id, arg_idx++, ff_flux_contribution_density_energy); _clSetArgs(kernel_id, arg_idx++, ff_flux_contribution_momentum_x); _clSetArgs(kernel_id, arg_idx++, ff_flux_contribution_momentum_y); _clSetArgs(kernel_id, arg_idx++, ff_flux_contribution_momentum_z); _clSetArgs(kernel_id, arg_idx++, &nelr, sizeof(int)); _clInvokeKernel(kernel_id, work_items, work_group_size); } void time_step(int j, int nelr, cl_mem old_variables, cl_mem variables, cl_mem step_factors, cl_mem fluxes) { int work_items = nelr; int work_group_size = BLOCK_SIZE_4; int kernel_id = 4; int arg_idx = 0; _clSetArgs(kernel_id, arg_idx++, &j, sizeof(int)); _clSetArgs(kernel_id, arg_idx++, &nelr, sizeof(int)); _clSetArgs(kernel_id, arg_idx++, old_variables); _clSetArgs(kernel_id, arg_idx++, variables); _clSetArgs(kernel_id, arg_idx++, step_factors); _clSetArgs(kernel_id, arg_idx++, fluxes); _clInvokeKernel(kernel_id, work_items, work_group_size); } inline void compute_flux_contribution(float &density, float3 &momentum, float &density_energy, float &pressure, float3 &velocity, float3 &fc_momentum_x, float3 &fc_momentum_y, float3 &fc_momentum_z, float3 &fc_density_energy) { fc_momentum_x.x = velocity.x * momentum.x + pressure; fc_momentum_x.y = velocity.x * momentum.y; fc_momentum_x.z = velocity.x * momentum.z; fc_momentum_y.x = fc_momentum_x.y; fc_momentum_y.y = velocity.y * momentum.y + pressure; fc_momentum_y.z = velocity.y * momentum.z; fc_momentum_z.x = fc_momentum_x.z; fc_momentum_z.y = fc_momentum_y.z; fc_momentum_z.z = velocity.z * momentum.z + pressure; float de_p = density_energy + pressure; fc_density_energy.x = velocity.x * de_p; fc_density_energy.y = velocity.y * de_p; fc_density_energy.z = velocity.z * de_p; } /* * Main function */ int main(int argc, char **argv) { printf("WG size of kernel:initialize = %d, WG size of " "kernel:compute_step_factor = %d, WG size of kernel:compute_flux = " "%d, WG size of kernel:time_step = %d\n", BLOCK_SIZE_1, BLOCK_SIZE_2, BLOCK_SIZE_3, BLOCK_SIZE_4); if (argc < 2) { std::cout << "specify data file name and [device type] [device id]" << std::endl; return 0; } const char *data_file_name = argv[1]; _clCmdParams(argc, argv); cl_mem ff_variable, ff_flux_contribution_momentum_x, ff_flux_contribution_momentum_y, ff_flux_contribution_momentum_z, ff_flux_contribution_density_energy; cl_mem areas, elements_surrounding_elements, normals; cl_mem variables, old_variables, fluxes, step_factors; float h_ff_variable[NVAR]; try { _clInit(device_type, device_id); // set far field conditions and load them into constant memory on the // gpu { // float h_ff_variable[NVAR]; const float angle_of_attack = float(3.1415926535897931 / 180.0f) * float(deg_angle_of_attack); h_ff_variable[VAR_DENSITY] = float(1.4); float ff_pressure = float(1.0f); float ff_speed_of_sound = sqrt(GAMMA * ff_pressure / h_ff_variable[VAR_DENSITY]); float ff_speed = float(ff_mach) * ff_speed_of_sound; float3 ff_velocity; ff_velocity.x = ff_speed * float(cos((float)angle_of_attack)); ff_velocity.y = ff_speed * float(sin((float)angle_of_attack)); ff_velocity.z = 0.0f; h_ff_variable[VAR_MOMENTUM + 0] = h_ff_variable[VAR_DENSITY] * ff_velocity.x; h_ff_variable[VAR_MOMENTUM + 1] = h_ff_variable[VAR_DENSITY] * ff_velocity.y; h_ff_variable[VAR_MOMENTUM + 2] = h_ff_variable[VAR_DENSITY] * ff_velocity.z; h_ff_variable[VAR_DENSITY_ENERGY] = h_ff_variable[VAR_DENSITY] * (float(0.5f) * (ff_speed * ff_speed)) + (ff_pressure / float(GAMMA - 1.0f)); float3 h_ff_momentum; h_ff_momentum.x = *(h_ff_variable + VAR_MOMENTUM + 0); h_ff_momentum.y = *(h_ff_variable + VAR_MOMENTUM + 1); h_ff_momentum.z = *(h_ff_variable + VAR_MOMENTUM + 2); float3 h_ff_flux_contribution_momentum_x; float3 h_ff_flux_contribution_momentum_y; float3 h_ff_flux_contribution_momentum_z; float3 h_ff_flux_contribution_density_energy; compute_flux_contribution(h_ff_variable[VAR_DENSITY], h_ff_momentum, h_ff_variable[VAR_DENSITY_ENERGY], ff_pressure, ff_velocity, h_ff_flux_contribution_momentum_x, h_ff_flux_contribution_momentum_y, h_ff_flux_contribution_momentum_z, h_ff_flux_contribution_density_energy); // copy far field conditions to the gpu // cl_mem ff_variable, ff_flux_contribution_momentum_x, // ff_flux_contribution_momentum_y,ff_flux_contribution_momentum_z, // ff_flux_contribution_density_energy; ff_variable = _clMalloc(NVAR * sizeof(float)); ff_flux_contribution_momentum_x = _clMalloc(sizeof(float3)); ff_flux_contribution_momentum_y = _clMalloc(sizeof(float3)); ff_flux_contribution_momentum_z = _clMalloc(sizeof(float3)); ff_flux_contribution_density_energy = _clMalloc(sizeof(float3)); _clMemcpyH2D(ff_variable, h_ff_variable, NVAR * sizeof(float)); _clMemcpyH2D(ff_flux_contribution_momentum_x, &h_ff_flux_contribution_momentum_x, sizeof(float3)); _clMemcpyH2D(ff_flux_contribution_momentum_y, &h_ff_flux_contribution_momentum_y, sizeof(float3)); _clMemcpyH2D(ff_flux_contribution_momentum_z, &h_ff_flux_contribution_momentum_z, sizeof(float3)); _clMemcpyH2D(ff_flux_contribution_density_energy, &h_ff_flux_contribution_density_energy, sizeof(float3)); _clFinish(); } int nel; int nelr; // read in domain geometry // float* areas; // int* elements_surrounding_elements; // float* normals; { std::ifstream file(data_file_name); if (file == NULL) { throw(string("can not find/open file!")); } file >> nel; nelr = block_length * ((nel / block_length) + std::min(1, nel % block_length)); std::cout << "--cambine: nel=" << nel << ", nelr=" << nelr << std::endl; float *h_areas = new float[nelr]; int *h_elements_surrounding_elements = new int[nelr * NNB]; float *h_normals = new float[nelr * NDIM * NNB]; // read in data for (int i = 0; i < nel; i++) { file >> h_areas[i]; for (int j = 0; j < NNB; j++) { file >> h_elements_surrounding_elements[i + j * nelr]; if (h_elements_surrounding_elements[i + j * nelr] < 0) h_elements_surrounding_elements[i + j * nelr] = -1; h_elements_surrounding_elements[i + j * nelr]--; // it's coming // in with // Fortran // numbering for (int k = 0; k < NDIM; k++) { file >> h_normals[i + (j + k * NNB) * nelr]; h_normals[i + (j + k * NNB) * nelr] = -h_normals[i + (j + k * NNB) * nelr]; } } } // fill in remaining data int last = nel - 1; for (int i = nel; i < nelr; i++) { h_areas[i] = h_areas[last]; for (int j = 0; j < NNB; j++) { // duplicate the last element h_elements_surrounding_elements[i + j * nelr] = h_elements_surrounding_elements[last + j * nelr]; for (int k = 0; k < NDIM; k++) h_normals[last + (j + k * NNB) * nelr] = h_normals[last + (j + k * NNB) * nelr]; } } areas = alloc<float>(nelr); upload<float>(areas, h_areas, nelr); elements_surrounding_elements = alloc<int>(nelr * NNB); upload<int>(elements_surrounding_elements, h_elements_surrounding_elements, nelr * NNB); normals = alloc<float>(nelr * NDIM * NNB); upload<float>(normals, h_normals, nelr * NDIM * NNB); delete[] h_areas; delete[] h_elements_surrounding_elements; delete[] h_normals; } // Create arrays and set initial conditions variables = alloc<float>(nelr * NVAR); int tp = 0; initialize_variables(nelr, variables, ff_variable); old_variables = alloc<float>(nelr * NVAR); fluxes = alloc<float>(nelr * NVAR); step_factors = alloc<float>(nelr); // make sure all memory is floatly allocated before we start timing initialize_variables(nelr, old_variables, ff_variable); initialize_variables(nelr, fluxes, ff_variable); _clMemset(step_factors, 0, sizeof(float) * nelr); // make sure CUDA isn't still doing something before we start timing _clFinish(); // these need to be computed the first time in order to compute time // step std::cout << "Starting..." << std::endl; // Begin iterations for (int i = 0; i < iterations; i++) { copy<float>(old_variables, variables, nelr * NVAR); // for the first iteration we compute the time step compute_step_factor(nelr, variables, areas, step_factors); for (int j = 0; j < RK; j++) { compute_flux(nelr, elements_surrounding_elements, normals, variables, ff_variable, fluxes, ff_flux_contribution_density_energy, ff_flux_contribution_momentum_x, ff_flux_contribution_momentum_y, ff_flux_contribution_momentum_z); time_step(j, nelr, old_variables, variables, step_factors, fluxes); } } _clFinish(); if (getenv("OUTPUT")) { std::cout << "Saving solution..." << std::endl; dump(variables, nel, nelr); std::cout << "Saved solution..." << std::endl; } _clStatistics(); std::cout << "Cleaning up..." << std::endl; //--release resources _clFree(ff_variable); _clFree(ff_flux_contribution_momentum_x); _clFree(ff_flux_contribution_momentum_y); _clFree(ff_flux_contribution_momentum_z); _clFree(ff_flux_contribution_density_energy); _clFree(areas); _clFree(elements_surrounding_elements); _clFree(normals); _clFree(variables); _clFree(old_variables); _clFree(fluxes); _clFree(step_factors); _clRelease(); std::cout << "Done..." << std::endl; } catch (string msg) { std::cout << "--cambine:( an exception catched in main body ->" << msg << std::endl; _clFree(ff_variable); _clFree(ff_flux_contribution_momentum_x); _clFree(ff_flux_contribution_momentum_y); _clFree(ff_flux_contribution_momentum_z); _clFree(ff_flux_contribution_density_energy); _clFree(areas); _clFree(elements_surrounding_elements); _clFree(normals); _clFree(variables); _clFree(old_variables); _clFree(fluxes); _clFree(step_factors); _clRelease(); } catch (...) { std::cout << "--cambine:( unknow exceptions in main body..." << std::endl; _clFree(ff_variable); _clFree(ff_flux_contribution_momentum_x); _clFree(ff_flux_contribution_momentum_y); _clFree(ff_flux_contribution_momentum_z); _clFree(ff_flux_contribution_density_energy); _clFree(areas); _clFree(elements_surrounding_elements); _clFree(normals); _clFree(variables); _clFree(old_variables); _clFree(fluxes); _clFree(step_factors); _clRelease(); } return 0; }
[ "alexanderpowell@Alexanders-MacBook-Pro-2.local" ]
alexanderpowell@Alexanders-MacBook-Pro-2.local
2171893f7d86e3791f05ab23bddd81b30e2400d2
14887180edd20bff6d723d2d2e7b823e7626004e
/FadeRenderer.cpp
552a61ac528809fa7a14b9997e15cbd1c1d5db91
[]
no_license
MichaelDiBernardo/splash
97835e735d107f998848eb645ec587656a730a09
24024a24fa71910894bf73d87cfab38881eb87f8
refs/heads/master
2022-11-01T12:37:34.690285
2022-10-21T01:51:55
2022-10-21T01:51:55
14,156,026
1
0
null
null
null
null
UTF-8
C++
false
false
2,407
cpp
// Author: mikedebo@gmail.com (Michael DiBernardo) // Copyright Michael DiBernardo 2006 // Implementation of class FadeRenderer and related constructs. #include "FadeRenderer.h" #include "os.h" #include "Config.h" #include "Timer.h" FadeRenderer::FadeRenderer(int secondsToFade, NextAction doneAction, Renderer* sceneToFade) : durationBefore_(0), duration_(secondsToFade * 1000), doneAction_(doneAction), target_(sceneToFade), fadeTimer_(new Timer()) { fadeTimer_->start(); } FadeRenderer::FadeRenderer(int secondsBeforeFade, int secondsToFade, NextAction doneAction, Renderer* sceneToFade) : durationBefore_(secondsBeforeFade * 1000), duration_(secondsToFade * 1000), doneAction_(doneAction), target_(sceneToFade), fadeTimer_(new Timer()) { fadeTimer_->start(); } FadeRenderer::~FadeRenderer() { delete target_; delete fadeTimer_; } void FadeRenderer::init() { } NextAction FadeRenderer::render() { target_->render(); glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); gluOrtho2D(0, Config::MAX_2D_COORD, 0, Config::MAX_2D_COORD); glMatrixMode(GL_MODELVIEW); double elapsed = fadeTimer_->getTimeInMilliseconds(); double fadeFactor = (elapsed - durationBefore_) / duration_; if (fadeFactor < 0.0) fadeFactor = 0.0; glColor4d(0, 0, 0, fadeFactor); glBegin(GL_QUADS); glVertex3f(0, 0, 0); glVertex3f(Config::MAX_2D_COORD, 0, 0); glVertex3f(Config::MAX_2D_COORD, Config::MAX_2D_COORD, 0); glVertex3f(0, Config::MAX_2D_COORD, 0); glEnd(); glMatrixMode(GL_PROJECTION); glPopMatrix(); glMatrixMode(GL_MODELVIEW); if (elapsed > (duration_ + durationBefore_)) { return doneAction_; } else { return RA_REDISPLAY; } } void FadeRenderer::reshape(int newWidth, int newHeight) { target_->reshape(newWidth, newHeight); } void FadeRenderer::onKeyDown(unsigned char key, int x, int y) { target_->onKeyDown(key, x, y); } void FadeRenderer::onKeyUp(unsigned char key, int x, int y) { target_->onKeyUp(key, x, y); } void FadeRenderer::onSpecialKeyDown(int key, int x, int y) { target_->onSpecialKeyDown(key, x, y); } void FadeRenderer::onSpecialKeyUp(int key, int x, int y) { target_->onSpecialKeyUp(key, x, y); } bool FadeRenderer::shouldKeysRepeat() const { return target_->shouldKeysRepeat(); } const Renderer& FadeRenderer::getRenderer() const { return *target_; }
[ "mikedebo@gmail.com" ]
mikedebo@gmail.com
baa2d8018590855085267e9cd54dfafe61603963
dd70b3ea90bea7dc08dbdc164bebc934f6207cb9
/validation_tests/root/basic.cpp
0e22887b1c3060b64abbe6c73970b9b8a92758cd
[]
no_license
robinmolle/ESIPAPCpp
3e42c499ecf7213ca2643a66996ef739d7e58d18
03efff7f29a2dbe80c7ccc5649eb65fd654a9b62
refs/heads/main
2023-03-01T18:37:53.844119
2021-02-10T07:58:47
2021-02-10T07:58:47
null
0
0
null
null
null
null
UTF-8
C++
false
false
199
cpp
#include <iostream> #include <TROOT.h> int main() { std::cout << "BEGIN Test" << std::endl; std::cout << gROOT->GetVersion() << std::endl; std::cout << "END Test" << std::endl; return 42; }
[ "eric.conte@iphc.cnrs.fr" ]
eric.conte@iphc.cnrs.fr
19f545162ae56e4c09bf56a5caee65b5f4ea1e85
5f12bccc76142365ba4e1a28db800d01c952a24a
/reco/HierarchicalClustering/ATHierarchicalClusteringGraph.hpp
8c4ecf7d2799d1d7b315398a174d1d4adae3ca83
[]
no_license
sunlijie-msu/ATTPCROOTv2
7ad98fd6f85126e5b480f7897a2b98d1fc8bf184
870b75170990b0782918f17b2230045ab1f458ef
refs/heads/master
2023-06-02T06:28:30.308596
2021-02-26T14:59:53
2021-02-26T14:59:53
null
0
0
null
null
null
null
UTF-8
C++
false
false
3,989
hpp
#ifndef ATHIERARCHICALCLUSTERINGGRAPH_H #define ATHIERARCHICALCLUSTERINGGRAPH_H #include <limits> #include <numeric> #include <vector> #include <pcl/io/io.h> namespace ATHierarchicalClusteringGraph { struct edge { size_t voxelIndexA; size_t voxelIndexB; float distance; }; struct state { std::vector<edge> edges; std::vector<size_t> groups; }; template <class T> using MstMetric = std::function<float(T const &, T const &)>; template <class T> inline float DefaultMstMetric(T const &pointA, T const &pointB) { Eigen::Vector3f diff( pointA.x - pointB.x, pointA.y - pointB.y, pointA.z - pointB.z ); return diff.dot(diff); } template <class T> std::vector<edge> CalculateEdges(pcl::PointCloud<T> const &cloud, MstMetric<T> metric) { const size_t cloud_size = cloud.size(); std::vector<edge> result; result.reserve(cloud_size * (cloud_size - 1) / 2); for(size_t i = 0; i < cloud_size; ++i) { auto const &pointA = cloud[i]; for(size_t j = i + 1; j < cloud_size; ++j) { auto const &pointB = cloud[j]; float distance = metric(pointA, pointB); edge e = { i, // voxelIndexA j, // voxelIndexB distance // distance }; result.push_back(e); } } std::sort( result.begin(), result.end(), [] (edge const &lhs, edge const &rhs) { return lhs.distance < rhs.distance; } ); return result; } template <class T> std::vector<state> CalculateMinimumSpanningTree(pcl::PointCloud<T> const &cloud, MstMetric<T> metric = DefaultMstMetric<T>) { std::vector<edge> edges = CalculateEdges(cloud, metric); std::vector<state> result; std::vector<edge> selectedEdges; std::vector<size_t> groups(cloud.size()); std::iota(groups.begin(), groups.end(), (size_t)0); for(edge const &edgeElement : edges) { size_t groupA = groups[edgeElement.voxelIndexA]; size_t groupB = groups[edgeElement.voxelIndexB]; // if no circle if(groupA != groupB) { selectedEdges.push_back(edgeElement); // merge groups for(auto it = groups.begin(); it != groups.end(); ++it) { if(*it == groupB) *it = groupA; } state state = { selectedEdges, // edges groups, // groups }; result.push_back(state); } } return result; } Eigen::MatrixXf CalculateAllPairsShortestPath(std::vector<edge> const &edges, size_t nodeCount) { Eigen::MatrixXf result = Eigen::MatrixXf::Constant(nodeCount, nodeCount, std::numeric_limits<float>::infinity()); // init for (edge const &edgeElement : edges) { float const distance = std::sqrt(edgeElement.distance); result(edgeElement.voxelIndexA, edgeElement.voxelIndexB) = distance; result(edgeElement.voxelIndexB, edgeElement.voxelIndexA) = distance; } // Floyd's Algorithm for (size_t k = 0; k < nodeCount; ++k) { for (size_t i = 0; i < (nodeCount - 1); ++i) { for (size_t j = (i + 1); j < nodeCount; ++j) { float const newDistance = std::min(result(i, j), (result(i, k) + result(k, j))); result(i, j) = newDistance; result(j, i) = newDistance; } } } return result; } } #endif
[ "lukas.aymans@googlemail.com" ]
lukas.aymans@googlemail.com
760df4e1aa0c390c6a8e57a286a26a82618bb1e2
43250cad8ea54eae832689befa3383da09fc4ffa
/OnOffClient.cpp
673c89c3fafdd405f5f7fc654b63c2cb4e0eb5f3
[]
no_license
gaixas1/rinaApps
354bfcf2a395a9fa10d84a4e85cf53f455a84fd8
d9848151087f5d67ce448efb6e8501d9f0b00c67
refs/heads/master
2020-03-07T23:21:23.279796
2018-04-26T18:12:28
2018-04-26T18:12:28
127,779,178
0
0
null
null
null
null
UTF-8
C++
false
false
5,485
cpp
#include <tclap/CmdLine.h> #include <random> #include "include/test_client_base.h" class OnOffClient : public TestClientBase { public: OnOffClient(const std::string Name, const std::string Instance, const std::string Servername, const std::string ServerInstance, const std::string DIF, int FlowIdent, int QosIdent, int TestDuration, unsigned int _packet_size, const unsigned long long _ratebps, const int _avg_ms_on, const int _avg_ms_off) : TestClientBase(Name, Instance, Servername, ServerInstance, DIF, FlowIdent, QosIdent, TestDuration) { if (_packet_size < sizeof(dataSDU)) { sdu_size = sizeof(dataSDU); } else if (_packet_size > BUFF_SIZE) { sdu_size = BUFF_SIZE; } else { sdu_size = _packet_size; } avg_ms_on = _avg_ms_on > 1 ? _avg_ms_on : 1; avg_ms_off = _avg_ms_off > 1 ? _avg_ms_off : 1; long long interval_ns; interval_ns = 1000000000L; // ns/s interval_ns *= sdu_size * 8L; // b/B interval_ns /= _ratebps; // b/s interval = std::chrono::nanoseconds(interval_ns); } protected: int sdu_size; int avg_ms_on, avg_ms_off; std::chrono::nanoseconds interval; int RunFlow() { std::chrono::time_point<std::chrono::system_clock> t = std::chrono::system_clock::now(); std::default_random_engine generator(t.time_since_epoch().count()); std::exponential_distribution<double> on_distribution(1.0 / avg_ms_on); std::exponential_distribution<double> off_distribution(1.0 / avg_ms_off); bool startOff = (rand() % (avg_ms_on + avg_ms_off) <= avg_ms_off); long int phase_duration; if (startOff) { phase_duration = (long int)off_distribution(generator); t += std::chrono::milliseconds(phase_duration); std::this_thread::sleep_until(t); } int i = 1; while (t < Endtime) { phase_duration = (long int)on_distribution(generator); auto change = t + std::chrono::milliseconds(phase_duration); if (change > Endtime) { change = Endtime; } long int sent = 0; while (t < change) { if (SendData(sdu_size) != sdu_size) return -1; sent++; t += interval; std::this_thread::sleep_until(t); } phase_duration = (long int)off_distribution(generator); t += std::chrono::milliseconds(phase_duration); std::this_thread::sleep_until(t); }; return 0; } }; int main(int argc, char ** argv) { std::string Name, Instance; std::string ServerName, ServerInstance; std::string DIF; int FlowIdent, QoSIdent, TestDuration; unsigned int PacketSize; unsigned long long RateBPS; int AVG_ms_ON, AVG_ms_OFF; std::string QoSFile; try { TCLAP::CmdLine cmd("OnOffClient", ' ', "2.0"); //Base params TCLAP::ValueArg<std::string> Name_a("n","name","Application process name, default = OnOffClient", false, "OnOffClient", "string"); TCLAP::ValueArg<std::string> Instance_a("i","instance","Application process instance, default = 1", false, "1", "string"); TCLAP::ValueArg<std::string> sName_a("m", "sname", "Server process name, default = DropServer", false, "DropServer", "string"); TCLAP::ValueArg<std::string> sInstance_a("j", "sinstance", "Server process instance, default = 1",false, "1", "string"); TCLAP::ValueArg<std::string> QoSFile_a("Q", "qos", "QoSRequirements filename, default = \"\"", false, "", "string"); TCLAP::ValueArg<std::string> DIF_a("D", "dif", "DIF to use, empty for any DIF, default = \"\"",false, "", "string"); //Client params TCLAP::ValueArg<int> FlowIdent_a("I", "flowid", "Unique flow identifier, default = 0",false, 0, "int"); TCLAP::ValueArg<int> QoSIdent_a("q", "qosid", "QoS identifier, default = 0",false, 0, "int"); TCLAP::ValueArg<int> TestDuration_a("d", "duration", "Test duration in s, default = 10",false, 10, "int"); //OnOffParams TCLAP::ValueArg<unsigned int> PacketSize_a("S", "pSize", "Packet size in B, default 1000B", false, 1000, "unsigned int"); TCLAP::ValueArg<int> AVG_ms_ON_a("O", "dOn", "Average duration of On interval in ms, default 1000 ms", false, 1000, "int"); TCLAP::ValueArg<int> AVG_ms_OFF_a("F", "dOff", "Average duration of Off interval in ms, default 1000 ms",false, 1000, "int"); TCLAP::ValueArg<float> RateMBPS_a("M", "Mbps", "Rate in Mbps, default = 10.0",false, 10.0f, "float"); cmd.add(Name_a); cmd.add(Instance_a); cmd.add(sName_a); cmd.add(sInstance_a); cmd.add(QoSFile_a); cmd.add(FlowIdent_a); cmd.add(QoSIdent_a); cmd.add(TestDuration_a); cmd.add(PacketSize_a); cmd.add(AVG_ms_ON_a); cmd.add(AVG_ms_OFF_a); cmd.add(RateMBPS_a); cmd.add(DIF_a); cmd.parse(argc, argv); Name = Name_a.getValue(); Instance = Instance_a.getValue(); ServerName = sName_a.getValue(); ServerInstance = sInstance_a.getValue(); QoSFile = QoSFile_a.getValue(); DIF = DIF_a.getValue(); FlowIdent = FlowIdent_a.getValue(); QoSIdent = QoSIdent_a.getValue(); TestDuration = TestDuration_a.getValue(); PacketSize = PacketSize_a.getValue(); AVG_ms_ON = AVG_ms_ON_a.getValue(); AVG_ms_OFF = AVG_ms_OFF_a.getValue(); float RateMBPS = RateMBPS_a.getValue(); RateBPS = 1000000; // 1Mbps RateBPS *= RateMBPS; } catch (TCLAP::ArgException &e) { std::cerr << e.error() << " for arg " << e.argId() << std::endl; std::cerr << "Failure reading parameters." << std::endl; return -1; } OnOffClient App(Name, Instance, ServerName, ServerInstance, DIF, FlowIdent, QoSIdent, TestDuration, PacketSize, RateBPS, AVG_ms_ON, AVG_ms_OFF); App.ReadQoSFile(QoSFile); return App.Run(); }
[ "gaixas1@gmail.com" ]
gaixas1@gmail.com
7f6156259d9c936b2d3ae414e167452888314ea2
246a16842feb7633edbe6291ff36b4c93edbb3c7
/conan-package/array/test_package/example.cpp
ddd8fd72d76a90305496de3731b92223f8b613e4
[]
no_license
curtkim/c-first
2c223949912c708734648cf29f98778249f79346
f6fa50108ab7c032b74199561698cef087405c37
refs/heads/master
2023-06-08T10:57:35.159250
2023-05-28T05:52:20
2023-05-28T05:52:20
213,894,731
3
1
null
null
null
null
UTF-8
C++
false
false
1,112
cpp
#include "array/array.h" #include "array/ein_reduce.h" #include <functional> #include <iostream> #include <random> using namespace nda; int main() { using my_3d_shape_type = shape<dim<>, dim<>, dim<>>; constexpr int width = 16; constexpr int height = 10; constexpr int depth = 3; my_3d_shape_type my_3d_shape(width, height, depth); array<int, my_3d_shape_type> my_array(my_3d_shape); for (int z = 0; z < depth; z++) { for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { // Variadic verion: my_array(x, y, z) = 5; // Or the index_type versions: my_array({x, y, z}) = 5; my_array[{x, y, z}] = 5; } } } my_array.for_each_value([](int& value) { value = 5; }); /* for_all_indices(my_3d_shape, [&](int x, int y, int z) { my_array(x, y, z) = 5; }); for_each_index(my_3d_shape, [&](my_3d_shape_type::index_type i) { my_array[i] = 5; }); */ for_all_indices<2, 0, 1>(my_3d_shape, [](int x, int y, int z) { std::cout << x << ", " << y << ", " << z << std::endl; }); return 0; }
[ "curt.k@kakaomobility.com" ]
curt.k@kakaomobility.com
df40cc814283f8f412add26c498c13c1662a5fc4
a01363e94fc5c0e99d416717e76b30332340dc70
/Clase 28/ordenamiento.h
c27ef96b449d919cd64f66fc28f976bf344fd2e8
[]
no_license
phob0z/AyED
f0662e665322d51e56e9dbbc49a0db2714a908bc
554c17d529e37120f87bff75a7127a53c0b65e7f
refs/heads/main
2023-03-23T07:01:24.063299
2021-03-14T06:20:49
2021-03-14T06:20:49
329,105,972
0
0
null
null
null
null
UTF-8
C++
false
false
785
h
#include <iostream> using namespace std; void ordenamientoQuicksort(int vector[], int pinicial, int pfinal); void ordenamientoQuicksort(int vector[], int pinicial, int pfinal) { int i = pinicial; int j = pfinal; int piv = vector[(pinicial + pfinal) / 2]; int temp; do { while (vector[i]<piv) { i++; } while (vector[j]>piv) { j--; } if (i<=j) { swap(vector[j], vector[i]); // temp = vector[i]; // vector[i] = vector[j]; // vector[j] = temp; i++; j--; } } while (i <= j); if (pinicial < j) ordenamientoQuicksort(vector, pinicial, j); if (i < pfinal) ordenamientoQuicksort(vector, i, pfinal); }
[ "leonel.alfonso@gmail.com" ]
leonel.alfonso@gmail.com
8fba8c41340e4fdf171c93f80757aca16dcac010
ba1e90ae6ea9f8f74d9b542e159825341c717712
/2020/lcContest145D.cpp
aacea1d7da2db38786881ea0037cded5578d68e4
[]
no_license
sailesh2/CompetitiveCode
b384687a7caa8980ab9b9c9deef2488b0bfe9cd9
5671dac08216f4ce75d5992e6af8208fa2324d12
refs/heads/master
2021-06-24T22:39:11.396049
2020-11-27T05:22:17
2020-11-27T05:22:17
161,877,355
0
0
null
null
null
null
UTF-8
C++
false
false
3,945
cpp
class Solution { private: vector<string> rskills; map<string,int> peopleMap; map<string,int>::iterator peopleMapIt; map<string,int> mp; map<string,int>::iterator mpIt; int n; int minS=1000000000; vector<int> ans; string getNewCurrent(){ string s=""; for(int i=0;i<n;i++){ s.push_back('0'); } return s; } int getSkillPos(string skill){ mpIt = mp.find(skill); return mpIt->second; } void generatePeopleMap(vector<string> skills,int ind,int* has,int pos){ if(ind>=skills.size()){ string s=getNewCurrent(); for(int j=0;j<skills.size();j++){ if(has[j]==1){ int pos = getSkillPos(skills[j]); s[pos]='1'; } } peopleMap.insert(make_pair(s,pos)); return; } has[ind]=1; generatePeopleMap(skills, ind+1,has,pos); has[ind]=0; generatePeopleMap(skills,ind+1,has,pos); } void createPeopleMap(vector<vector<string> > peoples){ for(int j=0;j<rskills.size();j++){ mp.insert(make_pair(rskills[j],j)); } for(int i=0;i<peoples.size();i++){ int has[100005]={0}; generatePeopleMap(peoples[i],0,has,i); } } int getPeopleIndex(string s,int ind){ cout<<ind<<" "; peopleMapIt=peopleMap.find(s); if(peopleMapIt!=peopleMap.end()){ return peopleMapIt->second; } if(ind>=s.length()) return -1; if(s[ind]=='0') { s[ind]='1'; int pos = getPeopleIndex(s,ind+1); if(pos!=-1) return pos; s[ind]='0'; } return getPeopleIndex(s,ind+1); } void storePeople(vector<string> taken){ vector<int> v; for(int i=0;i<taken.size();i++){ if(isEmpty(taken[i])) continue; peopleMapIt=peopleMap.find(taken[i]); if(peopleMapIt==peopleMap.end()){ return; } v.push_back(peopleMapIt->second); } set<int> st; vector<int> dist; for(int i=0;i<v.size();i++){ if(st.count(v[i])==0){ st.insert(v[i]); dist.push_back(v[i]); } } if(dist.size()<minS){ minS=dist.size(); ans=dist; } } bool isEmpty(string s){ for(int i=0;i<s.length();i++){ if(s[i]=='1'){ return false; } } return true; } void smallestSufficentTeam(vector<string> taken, int* has){ int cnt=0; for(int i=0;i<rskills.size();i++){ if(has[i]==0){ cnt=1; has[i]=1; taken[taken.size()-1][i]='1'; smallestSufficentTeam(taken,has); taken[taken.size()-1][i]='0'; string newCurrent = getNewCurrent(); newCurrent[i]='1'; taken.push_back(newCurrent); smallestSufficentTeam(taken,has); taken.pop_back(); has[i]=0; } } if(cnt==0){ storePeople(taken); } } public: vector<int> smallestSufficientTeam(vector<string>& req_skills, vector<vector<string>>& people) { n=req_skills.size(); rskills=req_skills; createPeopleMap(people); vector<string> taken; string s=getNewCurrent(); taken.push_back(s); int has[100005]; smallestSufficentTeam(taken,has); return ans; } };
[ "sailesh.ku.upadhyaya@gmail.com" ]
sailesh.ku.upadhyaya@gmail.com
1dadcd90837869a3fcc60be5e0035ee08daaa487
bc38597594eca8e8693e52dca88941a3f2fc42f4
/DS28EA00.ino
3867c1000dfe88c4fe91a4c3f4b8452fe9dc392b
[]
no_license
mortonkopf/OneWire_DS28EA00
c95999f842ba1a263df613047a92489b52e64bfe
a936e8e1491da9ab07c78288054a3003e0068487
refs/heads/master
2020-04-06T07:06:32.281543
2016-09-04T09:01:31
2016-09-04T09:01:31
60,271,217
3
1
null
null
null
null
UTF-8
C++
false
false
22,804
ino
/********************************************************************** * File: DS28EA00 * Programmer: Maxim Integrated Systems Apps * Started: 22JAN14 * Updated: 23JAN14 * * Description: Demonstration of using the DS28EA00 1-wire devices. * Program supports up to 10 sensors on the bus. * Sensors can be added/removed from the bus while the * program is running to test CHAIN feature of the DS28EA00 * * This project requires the OneWire library which can be found at the * following link - http://www.pjrc.com/teensy/td_libs_OneWire.html * * To make this library visible to the Arduino IDE follow the * instructions at the following link - http://arduino.cc/en/Guide/Libraries * * This project was developed using the following hardware: * 1. Arduino UNO - http://arduino.cc/en/Main/ArduinoBoardUno * 2. Osepp LCD Shield - http://osepp.com/products/shield-arduino-compatible/16x2-lcd-display-keypad-shield/ * 3. DS28EA00EVKIT - http://www.maximintegrated.com/datasheet/index.mvp/id/5489 * * One of the EVKIT boards was modified to provide breadboard access to * the 1-wire data pin on the board. The rest of the boards were * connected with the provided cables. * * The following is how the dip-switches on each DS28EA00EVKIT board * were configured: * Board 1 - This board must be connected directly to the Arduino. * switch 1 - closed LEDA * switch 2 - closed LEDB * switch 3 - open A1 * switch 4 - open A2 * switch 5 - open B EXT * switch 6 - closed B GND * switch 7 - closed Vcc * * Board 2 and 3 - The position of these boards is irrelevant. * Changing the positions of these boards on the fly * demonstrates the CHAIN feature of the device * switch 1 - closed LEDA * switch 2 - closed LEDB * switch 3 - open A1 * switch 4 - open A2 * switch 5 - closed B EXT * switch 6 - open B GND * switch 7 - closed Vcc * * The Osepp LCD Shield is not required for this project to work. * Simply comment out the LCD relevant code (5 lines in setup, 4 lines * in the main loop) and make sure the function print_bus_data is * uncommented in the main loop. **********************************************************************/ #include <LiquidCrystal.h> #include <OneWire.h> #include "DS28EA00.h" /********************************************************************** *Following is specific to the Osepp LCD Shield **********************************************************************/ //select the pins used on the LCD Shield LiquidCrystal lcd(8, 9, 4, 5, 6, 7); int lcd_key = 0; int adc_key_in = 0; #define btnRIGHT 0 #define btnUP 1 #define btnDOWN 2 #define btnLEFT 3 #define btnSELECT 4 #define btnNONE 5 /*********************************************************************/ //Set up ow_bus. Pin can be changed in header file OneWire ow_bus(OW_BUS_PIN); //This is an array of structs ds28ea00_t ds28ea00_array[10]; unsigned char num_ds28ea00_on_bus = 0; unsigned char old_num_devices = 0; unsigned char selected_ds28ea00 = 0; unsigned char idx = 0; unsigned char idy = 0; unsigned char data; void setup() { lcd.begin(16, 2); // start the library lcd.setCursor(0,0); lcd.print("DS28EA00# ="); lcd.setCursor(0, 2); lcd.print("Temp = "); Serial.begin(9600); delay(500); ds28ea00_detect_num_devices(ds28ea00_array); old_num_devices = num_ds28ea00_on_bus; ds28ea00_config_bus(); } void loop() { //See if DS28EA00 sensors have been added/removed from bus ds28ea00_detect_num_devices(ds28ea00_array); //If they have, configure them if(old_num_devices != num_ds28ea00_on_bus) { ds28ea00_config_bus(); } old_num_devices = num_ds28ea00_on_bus; //Test for user input if(read_LCD_buttons() == btnSELECT) { selected_ds28ea00++; if(selected_ds28ea00 >= num_ds28ea00_on_bus) { selected_ds28ea00 = 0; } } //Display Current Device lcd.setCursor(12, 0); lcd.print(selected_ds28ea00 + 1); //Convert the temperature on selected device ds28ea00_convert_temperature(selected_ds28ea00); //Display temperature lcd.setCursor(7, 1); lcd.print(ds28ea00_array[selected_ds28ea00].temperature); // comment the following if print_bus_data() is used delay(100); //The following prints the members of each devices struct to a rolling terminal //The array of structs updates dynamically when devices are added removed. print_bus_data(); } /********************************************************************** *Function Defenitions - The arduino ide creates function prototypes * when the sketch is compiled, therefore none are * included in the header file as would be done in * a normal c or cpp project. Please refer to the * following link for more details about the * arduino build process. * http://www.arduino.cc/en/Hacking/BuildProcess **********************************************************************/ /********************************************************************** * Function: ds28ea00_detect_num_devices * Parameters: ds28ea00_t *device_array - Pointer to an array of type * ds28ea00_t * Returns: none * * Description: Detects devices on the bus **********************************************************************/ void ds28ea00_detect_num_devices(ds28ea00_t *device_array) { int state = 0; do { state = ds28ea00_sequence_discoverey(device_array); if(state == -1) { Serial.println("Error!"); } } while(state == -1); return; } /********** END ds28ea00_detect_num_devices****************************/ /********************************************************************** * Function: ds28ea00_config_bus * Parameters: none * Returns: none * * Description: Populates structs of devices with desired configuration and writes to devices on bus **********************************************************************/ void ds28ea00_config_bus(void) { for(idx = 0; idx < num_ds28ea00_on_bus; idx++) { ds28ea00_get_pwr_mode(idx); //see header file for #defines of the following ds28ea00_array[idx].temp_lo_alm = LO_ALARM; ds28ea00_array[idx].temp_hi_alm = HI_ALARM; ds28ea00_array[idx].config_register = RES_12_BIT; ds28ea00_write_scratchpad(idx); ds28ea00_copy_scratchpad(idx); ds28ea00_convert_temperature(idx); } return; } /********** END ds28ea00_config_bus************************************/ /********************************************************************** * Function: ds28ea00_sequence_discoverey * Parameters: ds28ea00_t *device_array - Pointer to an array of type * ds28ea00_t * Returns: none * * Description: Detects devices on the bus and populates the 64-bit rom * codes of the device_array **********************************************************************/ int ds28ea00_sequence_discoverey(ds28ea00_t *device_array) { unsigned char test_end_of_bus; idx = 0; idy = 0; ow_bus.reset(); ow_bus.skip(); ow_bus.write(CHAIN); ow_bus.write(CHAIN_ON); ow_bus.write(~CHAIN_ON); data = ow_bus.read(); if(data != VALID_SEQUENCE) { return(-1); } do { ow_bus.reset(); ow_bus.write(CONDITIONAL_READ_ROM); test_end_of_bus = 0xFF; for(idy = 0; idy < 8; idy++) { data = ow_bus.read(); test_end_of_bus &= data; device_array[idx].rom_code[idy] = data; } if(test_end_of_bus == 0xFF) { break; } idx++; num_ds28ea00_on_bus = idx; ow_bus.reset(); ow_bus.write(PIO_ACCESS_WRITE); ow_bus.write(CHAIN); ow_bus.write(CHAIN_DONE); ow_bus.write(~CHAIN_DONE); data = ow_bus.read(); if(data != VALID_SEQUENCE) { return(-1); } } while(test_end_of_bus != 0xFF); ow_bus.reset(); ow_bus.skip(); ow_bus.write(CHAIN); ow_bus.write(CHAIN_OFF); ow_bus.write(~CHAIN_OFF); data = ow_bus.read(); if(data != VALID_SEQUENCE) { return(-1); } return(0); } /********** END ds28ea00_sequence_discoverey***************************/ /********************************************************************** * Function: ds28ea00_get_pwr_mode * Parameters: unsigned char device - ds28ea00 struct offset in array * Returns: none * * Description: Initiates a READ_PWR_MODE command with the selected * ds28ea00 device and updates the power mode member of * the device's struct. **********************************************************************/ void ds28ea00_get_pwr_mode(unsigned char device) { ow_bus.reset(); ow_bus.select(ds28ea00_array[device].rom_code); ow_bus.write(READ_PWR_MODE); ds28ea00_array[device].pwr_mode = ow_bus.read(); return; } /********** END ds28ea00_get_pwr_mode**********************************/ /********************************************************************** * Function: ds28ea00_set_resolution * Parameters: unsigned char device - ds28ea00 struct offset in array * unsigned char val - byte representing resolution of * device * Returns: none * * Description: writes 'val' to configuration register of 'device' **********************************************************************/ void ds28ea00_set_resolution(unsigned char device, unsigned char val) { ds28ea00_array[device].config_register = val; ds28ea00_write_scratchpad(device); ds28ea00_copy_scratchpad(device); return; } /********** END ds28ea00_set_resolution********************************/ /********************************************************************** * Function: ds28ea00_set_hi_alarm * Parameters: unsigned char device - ds28ea00 struct offset in array * unsigned char val - byte representing hi alarm * * Returns: none * * Description: writes 'val' to hi alarm register of 'device' **********************************************************************/ void ds28ea00_set_hi_alarm(unsigned char device, unsigned char val) { ds28ea00_array[device].temp_hi_alm = val; ds28ea00_write_scratchpad(device); ds28ea00_copy_scratchpad(device); return; } /********** END ds28ea00_set_hi_alarm*********************************/ /********************************************************************** * Function: ds28ea00_set_lo_alarm * Parameters: unsigned char device - ds28ea00 struct offset in array * unsigned char val - byte representing lo alarm * * Returns: none * * Description: writes 'val' to lo alarm register of 'device' **********************************************************************/ void ds28ea00_set_lo_alarm(unsigned char device, unsigned char val) { ds28ea00_array[device].temp_lo_alm = val; ds28ea00_write_scratchpad(device); ds28ea00_copy_scratchpad(device); return; } /********** END ds28ea00_set_lo_alarm*********************************/ /********************************************************************** * Function: ds28ea00_read_scratchpad * Parameters: unsigned char device - ds28ea00 struct offset in array * Returns: none * * Description: Reads the selected device's scratchpad **********************************************************************/ void ds28ea00_read_scratchpad(unsigned char device) { int temp_lo_byte; int temp_hi_byte; ow_bus.reset(); ow_bus.select(ds28ea00_array[device].rom_code); ow_bus.write(READ_SCRATCHPAD); temp_lo_byte = ow_bus.read(); temp_hi_byte = ow_bus.read(); ds28ea00_array[device].temp_hi_alm = ow_bus.read(); ds28ea00_array[device].temp_lo_alm = ow_bus.read(); ds28ea00_array[device].config_register = ow_bus.read(); //last three bytes of scratchpad reserved so we don't care ow_bus.reset(); //build temp into single signed int ds28ea00_array[device].raw_temp = ((temp_hi_byte << 8) | temp_lo_byte); return; } /********** END ds28ea00_read_scratchpad*******************************/ /********************************************************************** * Function: ds28ea00_write_scratchpad * Parameters: unsigned char device - ds28ea00 struct offset in array * Returns: none * * Description: Writes the desired temperature alarms and configuration register to the selected device's scratchpad **********************************************************************/ void ds28ea00_write_scratchpad(unsigned char device) { ow_bus.reset(); ow_bus.select(ds28ea00_array[device].rom_code); ow_bus.write(WRITE_SCRATCHPAD); ow_bus.write(ds28ea00_array[device].temp_hi_alm); ow_bus.write(ds28ea00_array[device].temp_lo_alm); ow_bus.write(ds28ea00_array[device].config_register); ow_bus.reset(); return; } /********** END ds28ea00_write_scratchpad******************************/ /********************************************************************** * Function: ds28ea00_copy_scratchpad * Parameters: unsigned char device - ds28ea00 struct offset in array * Returns: none * * Description: Copies scratchpad of selected device to its EEPROM **********************************************************************/ void ds28ea00_copy_scratchpad(unsigned char device) { ow_bus.reset(); ow_bus.select(ds28ea00_array[device].rom_code); ow_bus.write(COPY_SCRATCHPAD); do { data = ow_bus.read(); } while(data != 0xFF); return; } /********** END ds28ea00_copy_scratchpad*******************************/ /********************************************************************** * Function: ds28ea00_convert_temperature * Parameters: unsigned char device - ds28ea00 struct offset in array * Returns: none * * Description: Initiates a temperature conversion on selected device **********************************************************************/ void ds28ea00_convert_temperature(unsigned char device) { int temp_lo_byte; int temp_hi_byte; ow_bus.reset(); ow_bus.select(ds28ea00_array[device].rom_code); ow_bus.write(CONVERT_TEMP); do { data = ow_bus.read(); } while(data = 0); ow_bus.reset(); ow_bus.select(ds28ea00_array[device].rom_code); ow_bus.write(READ_SCRATCHPAD); temp_lo_byte = ow_bus.read(); temp_hi_byte = ow_bus.read(); //we just want temp bytes so reset ow_bus.reset(); //build temp into single signed int ds28ea00_array[device].raw_temp = ((temp_hi_byte << 8) | temp_lo_byte); ds28ea00_format_temperature(device); return; } /********** END ds28ea00_convert_temperature***************************/ /********************************************************************** * Function: ds28ea00_format_temperature * Parameters: unsigned char device - ds28ea00 struct offset in array * Returns: none * * Description: Formats the raw temperature conversion **********************************************************************/ void ds28ea00_format_temperature(unsigned char device) { float f_temp = 0; int r_temp = ds28ea00_array[device].raw_temp; unsigned char sign = POSITIVE; if(r_temp & 0x8000) { sign = NEGATIVE; r_temp = ~r_temp + 1; } switch(ds28ea00_array[device].config_register) { case RES_9_BIT: r_temp = ((r_temp >> 3) & 0x1FF); f_temp = (r_temp >> 1); if(r_temp & 0x001) { f_temp += 0.5; } break; case RES_10_BIT: r_temp = ((r_temp >> 2) & 0x3FF); f_temp = (r_temp >> 2); for(idy = 0; idy < 2; idy++) { if(r_temp & (1 << idy)) { f_temp += (1.0/(1 << (2 - idy))); } } break; case RES_11_BIT: r_temp = ((r_temp >> 1) & 0x7FF); f_temp = (r_temp >> 3); for(idy = 0; idy < 3; idy++) { if(r_temp & (1 << idy)) { f_temp += (1.0/(1 << (3 - idy))); } } break; default : f_temp = (r_temp >> 4); for(idy = 0; idy < 4; idy++) { if(r_temp & (1 << idy)) { f_temp += (1.0/(1 << (4 - idy))); } } } if(sign == NEGATIVE) { ds28ea00_array[device].temperature = (-1*f_temp); } else { ds28ea00_array[device].temperature = f_temp; } return; } /********** END ds28ea00_format_temperature***************************/ /********************************************************************** * Function: ds28ea00_pio_read * Parameters: unsigned char device - ds28ea00 struct offset in array * Returns: none * * Description: Reads the PIO status register of the selected device **********************************************************************/ void ds28ea00_pio_read(unsigned char device) { ow_bus.reset(); ow_bus.select(ds28ea00_array[device].rom_code); ow_bus.write(PIO_ACCESS_READ); ds28ea00_array[device].pio_state = ow_bus.read(); ow_bus.reset(); return; } /********** END ds28ea00_pio_read**************************************/ /********************************************************************** * Function: ds28ea00_pio_write * Parameters: unsigned char device - ds28ea00 struct offset in array * Returns: none * * Description: Writes to the PIO assignment register of the selected * device **********************************************************************/ int ds28ea00_pio_write(unsigned char device, unsigned char val) { ow_bus.reset(); ow_bus.select(ds28ea00_array[device].rom_code); ow_bus.write(PIO_ACCESS_WRITE); ow_bus.write(val); ow_bus.write(~val); data = ow_bus.read(); if(data != VALID_SEQUENCE) { return(-1); } ds28ea00_array[device].pio_state = ow_bus.read(); ow_bus.reset(); return(0); } /********** END ds28ea00_pio_write*************************************/ /********************************************************************** * Function: print_bus_data * Parameters: none * Returns: none * * Description: Prints how many devices are on the bus and the members * of their structs. **********************************************************************/ void print_bus_data(void) { Serial.print("Number of DS28EA00 on bus = "); Serial.println(num_ds28ea00_on_bus); Serial.println(""); for(idx = 0; idx < num_ds28ea00_on_bus; idx++) { Serial.print("DS28EA00 #"); Serial.println(idx + 1); Serial.print("64-bit ROM code = "); for(idy = 0; idy < 8; idy++) { data = ds28ea00_array[idx].rom_code[idy]; if(data > 0x0F) { Serial.print(data , HEX); } else { Serial.print(0); Serial.print(data , HEX); } } Serial.println(""); Serial.print("Power Mode = "); Serial.println(ds28ea00_array[idx].pwr_mode, HEX); Serial.print("Raw Temperature = "); Serial.println(ds28ea00_array[idx].raw_temp, HEX); Serial.print("High Alarm = "); Serial.println(ds28ea00_array[idx].temp_hi_alm, HEX); Serial.print("Low Alarm = "); Serial.println(ds28ea00_array[idx].temp_lo_alm, HEX); Serial.print("Configuration Register = "); Serial.println(ds28ea00_array[idx].config_register, HEX); Serial.print("Temperature = "); Serial.println(ds28ea00_array[idx].temperature, HEX); Serial.print("Pin State = "); Serial.println(ds28ea00_array[idx].pio_state, HEX); Serial.println(""); } delay(2500); return; } /********** END print_bus_data*****************************************/ /********************************************************************** *Following is specific to the Osepp LCD Shield **********************************************************************/ /********************************************************************** * Function: read_LCD_buttons * Parameters: none * Returns: A int representing button pressed * * Description: Taken from Osepp LCD Shield example. The shield uses a * voltage divider network with different taps to represent * each button based on the analog voltage read in on A0. **********************************************************************/ int read_LCD_buttons() { adc_key_in = analogRead(0); //btnNone read first for speed since most likely case if (adc_key_in > 1000) return btnNONE; if (adc_key_in < 50) return btnRIGHT; if (adc_key_in < 195) return btnUP; if (adc_key_in < 380) return btnDOWN; if (adc_key_in < 555) return btnLEFT; if (adc_key_in < 790) return btnSELECT; return btnNONE; // when all others fail, return this... } /********** END ow_receive_conformation********************************/ /********************************************************************** * Function: * Parameters: * Returns: * * Description: **********************************************************************/ /********** END function**********************************************/ /********************************************************************** * Copyright (C) 2013 Maxim Integrated Products, Inc., All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of Maxim Integrated * Products, Inc. shall not be used except as stated in the Maxim Integrated * Products, Inc. Branding Policy. * * The mere transfer of this software does not imply any licenses * of trade secrets, proprietary technology, copyrights, patents, * trademarks, maskwork rights, or any other form of intellectual * property whatsoever. Maxim Integrated Products, Inc. retains all * ownership rights. **********************************************************************/
[ "mariusmdg@live.co.uk" ]
mariusmdg@live.co.uk
d0d0033466d73e82a8852c79f9fd1cae77b67f22
898f517714dcd43a968bf3647ff88352dfaa2395
/mongo_types.h
44874d1d665efe7cda3a8761f9f7f9f789f71068
[ "MIT" ]
permissive
InitialDLab/SONAR-SamplingIndex
54c7e8fb05a418e0be052ec740175edc3b67364d
c83d6f53f8419cdb78f49935f41eb39447918ced
refs/heads/master
2021-01-18T16:19:05.940489
2017-09-29T21:21:22
2017-09-29T21:21:22
86,735,043
3
0
null
null
null
null
UTF-8
C++
false
false
7,890
h
/* Copyright 2017 InitialDLab Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #pragma once #include <iostream> #include <iomanip> #include <ctime> #include <boost/geometry.hpp> #include <boost/geometry/geometries/point.hpp> #include <boost/functional/hash.hpp> #include "serialization/default_serializers.h" #include "serialization/serializer.h" namespace mongo_types { namespace bg = boost::geometry; // ObjectID in mongodb struct OID { OID() {} OID (std::string const& idstr) { from_string(idstr); } OID & operator = (std::string const& idstr) { from_string(idstr); return *this; } bool operator == (OID const& oid) const { return id == oid.id; } void from_string(std::string const& idstr) { assert(idstr.size() == oid_len * 2); auto iter = id.begin(); for(size_t i = 0; i < oid_len * 2; i += 2) { *iter = (char_map[(unsigned char)idstr[i]] << 4) + char_map[(unsigned char)idstr[i+1]]; ++iter; } } static constexpr size_t oid_len = 12; std::array<unsigned char, oid_len> id; static const unsigned char char_map[256]; }; inline std::ostream & operator << (std::ostream & out, OID const& oid) { std::ios old_state(nullptr); old_state.copyfmt(out); out << std::hex; for (auto c : oid.id) { if ((int)c > 0xf) out << (int)c; else if ((int)c > 0x0) out << '0' << (int)c; else out << "00"; } out.copyfmt(old_state); return out; } using point2d = bg::model::point<float, 2, bg::cs::cartesian>; using point3d = bg::model::point<float, 3, bg::cs::cartesian>; using box2d = bg::model::box<point2d>; using box3d = bg::model::box<point3d>; struct entry { entry () :loc(0,0) , timestamp(0) , oid() { } entry(float x, float y, int timestamp, std::string const & id) :loc(x,y) ,timestamp(timestamp) ,oid(id) { } point2d loc; // lat, lon int timestamp; OID oid; bool operator == (entry const& e) const { return oid == e.oid; } /* * get the point to calculate the Hilbert value from * basically we need a 3d integral point from (0,0,0) to (max,max,max) */ using hilbert_point_type = bg::model::point<unsigned int, 3, bg::cs::cartesian>; hilbert_point_type convert_for_hilbert(void) const { assert(timestamp >= 0); return hilbert_point_type( // lat: -90 ~ +90 (unsigned int)((loc.get<0>() + 90.0) * 10000000.0), // lon: -180 ~ +180 (unsigned int)((loc.get<1>() + 180.0) * 10000000.0), // we should have no entry prior to 1970 // so no worry about negative values (unsigned int)timestamp ); } void dump_to (std::ostream & out) const { out.write(reinterpret_cast<const char *>(this), sizeof(*this)); //out.write(reinterpret_cast<const char *>(&(loc.get<0>())), sizeof(float)); //out.write(reinterpret_cast<const char *>(&(loc.get<1>())), sizeof(float)); //out.write(reinterpret_cast<const char *>(&timestamp), sizeof(int)); //out.write(reinterpret_cast<const char *>(&oid), sizeof(OID)); //serializer<float>::dump(out, loc.get<0>()); //serializer<float>::dump(out, loc.get<1>()); //serializer<int>::dump(out, timestamp); //serializer<OID>::dump(out, oid); } void load_from (std::istream & in) { in.read(reinterpret_cast<char *>(this), sizeof(*this)); //float i; //serializer<float>::load(in, i); //loc.set<0>(i); //serializer<float>::load(in, i); //loc.set<1>(i); //serializer<int>::load(in, timestamp); //serializer<OID>::load(in, oid); } static constexpr size_t serialization_size = serializer<float>::size + serializer<float>::size + serializer<int>::size + serializer<OID>::size; point3d get_point(void) const { return point3d(loc.get<0>(), loc.get<1>(), timestamp); } }; inline std::ostream & operator << (std::ostream & out, entry & e) { // convert time // std::put_time not implemented in gcc... std::time_t t = e.timestamp; //tm * ti; char buffer[100]; strftime(buffer, 100, "%c %Z", std::gmtime(&t)); out << bg::wkt(e.loc) << ' ' << e.oid << ' ' << e.timestamp << ' ' << buffer; return out; } inline std::istream & operator >> (std::istream & in, entry & e) { float x,y; long ts; std::string id; in >> x >> y >> ts >> id; e.loc.set<0>(x); e.loc.set<1>(y); e.oid = id; e.timestamp = ts / 1000; return in; } struct sample_entry { sample_entry() : loc() , timestamp(0) , oid() { } sample_entry(entry const& e) : loc(e.loc) , timestamp(e.timestamp) , oid(e.oid) { } point3d get_point(void) const { return point3d(loc.get<0>(), loc.get<1>(), timestamp); } using hilbert_point_type = bg::model::point<unsigned int, 3, bg::cs::cartesian>; hilbert_point_type convert_for_hilbert(void) const { assert(timestamp >= 0); return hilbert_point_type( // lat: -90 ~ +90 (unsigned int)((loc.get<0>() + 90.0) * 10000000.0), // lon: -180 ~ +180 (unsigned int)((loc.get<1>() + 180.0) * 10000000.0), // we should have no entry prior to 1970 // so no worry about negative values (unsigned int)timestamp ); } point2d loc; // lat, lon int timestamp; OID oid; }; inline bool operator == (entry const& e, sample_entry const& se) { return e.oid == se.oid; } inline bool operator == (sample_entry const& se, entry const& e) { return e.oid == se.oid; } inline bool operator == (sample_entry const& se1, sample_entry const& se2) { return se1.oid == se2.oid; } inline std::ostream & operator << (std::ostream & out, sample_entry & e) { // convert time // std::put_time not implemented in gcc... std::time_t t = e.timestamp; //tm * ti; char buffer[100]; strftime(buffer, 100, "%c %Z", std::gmtime(&t)); out << bg::wkt(e.loc) << ' ' << e.timestamp << ' ' << buffer; return out; } } // namespace mongo_types template <> struct has_dump_load_method<mongo_types::entry> { static constexpr bool value = true; }; namespace std { template <> struct hash<mongo_types::sample_entry> { std::size_t operator () (mongo_types::sample_entry const& e) const { return boost::hash_range(e.oid.id.begin(), e.oid.id.end()); } }; }
[ "robert.christensen@gmail.com" ]
robert.christensen@gmail.com
f3055838b01ae9c90ab4154c2257ce18c1e60fc3
c4b2f0b5795bddf122429ad2706e4b12d7914bbe
/chrome/browser/notifications/notification_platform_bridge_win.cc
c2a8befe2a41799ace1dbd5905b8af292545948a
[ "BSD-3-Clause" ]
permissive
codeandcircuit/chromium
976e3a0f06dce58eb48d25a5ba25a6e8e1c45426
0588d0628f73cfb7f01639afe4145655cf922744
refs/heads/master
2022-12-28T07:56:50.885265
2018-03-12T16:36:22
2018-03-12T16:36:22
null
0
0
null
null
null
null
UTF-8
C++
false
false
30,396
cc
// Copyright 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/notifications/notification_platform_bridge_win.h" #include <NotificationActivationCallback.h> #include <activation.h> #include <wrl.h> #include <wrl/client.h> #include <wrl/event.h> #include <wrl/wrappers/corewrappers.h> #include <memory> #include <utility> #include "base/bind.h" #include "base/command_line.h" #include "base/compiler_specific.h" #include "base/feature_list.h" #include "base/hash.h" #include "base/logging.h" #include "base/strings/string16.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_split.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "base/task_scheduler/post_task.h" #include "base/win/core_winrt_util.h" #include "base/win/registry.h" #include "base/win/scoped_hstring.h" #include "base/win/scoped_winrt_initializer.h" #include "base/win/windows_version.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/notifications/notification_common.h" #include "chrome/browser/notifications/notification_display_service_impl.h" #include "chrome/browser/notifications/notification_handler.h" #include "chrome/browser/notifications/notification_image_retainer.h" #include "chrome/browser/notifications/notification_launch_id.h" #include "chrome/browser/notifications/notification_template_builder.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/common/chrome_features.h" #include "chrome/common/chrome_switches.h" #include "chrome/install_static/install_util.h" #include "chrome/installer/util/install_util.h" #include "chrome/installer/util/shell_util.h" #include "components/version_info/channel.h" #include "content/public/browser/browser_thread.h" #include "ui/message_center/public/cpp/notification.h" namespace mswr = Microsoft::WRL; namespace mswrw = Microsoft::WRL::Wrappers; namespace winfoundtn = ABI::Windows::Foundation; namespace winui = ABI::Windows::UI; namespace winxml = ABI::Windows::Data::Xml; using base::win::ScopedHString; using message_center::RichNotificationData; namespace { // This string needs to be max 16 characters to work on Windows 10 prior to // applying Creators Update (build 15063). const wchar_t kGroup[] = L"Notifications"; typedef winfoundtn::ITypedEventHandler< winui::Notifications::ToastNotification*, winui::Notifications::ToastDismissedEventArgs*> ToastDismissedHandler; typedef winfoundtn::ITypedEventHandler< winui::Notifications::ToastNotification*, winui::Notifications::ToastFailedEventArgs*> ToastFailedHandler; // Templated wrapper for winfoundtn::GetActivationFactory(). template <unsigned int size, typename T> HRESULT CreateActivationFactory(wchar_t const (&class_name)[size], T** object) { ScopedHString ref_class_name = ScopedHString::Create(base::StringPiece16(class_name, size - 1)); return base::win::RoGetActivationFactory(ref_class_name.get(), IID_PPV_ARGS(object)); } void ForwardNotificationOperationOnUiThread( NotificationCommon::Operation operation, NotificationHandler::Type notification_type, const GURL& origin, const std::string& notification_id, const std::string& profile_id, bool incognito, const base::Optional<int>& action_index, const base::Optional<base::string16>& reply, const base::Optional<bool>& by_user) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); if (!g_browser_process) return; g_browser_process->profile_manager()->LoadProfile( profile_id, incognito, base::Bind(&NotificationDisplayServiceImpl::ProfileLoadedCallback, operation, notification_type, origin, notification_id, action_index, reply, by_user)); } } // namespace // static NotificationPlatformBridge* NotificationPlatformBridge::Create() { return new NotificationPlatformBridgeWin(); } // static bool NotificationPlatformBridge::CanHandleType( NotificationHandler::Type notification_type) { return notification_type != NotificationHandler::Type::TRANSIENT; } class NotificationPlatformBridgeWinImpl : public base::RefCountedThreadSafe<NotificationPlatformBridgeWinImpl>, public content::BrowserThread::DeleteOnThread< content::BrowserThread::UI> { public: explicit NotificationPlatformBridgeWinImpl( scoped_refptr<base::SequencedTaskRunner> task_runner) : image_retainer_( std::make_unique<NotificationImageRetainer>(task_runner)), task_runner_(std::move(task_runner)) { DCHECK(task_runner_); com_functions_initialized_ = base::win::ResolveCoreWinRTDelayload() && ScopedHString::ResolveCoreWinRTStringDelayload(); } // Obtain an IToastNotification interface from a given XML (provided by the // NotificationTemplateBuilder). HRESULT GetToastNotification( const message_center::Notification& notification, const NotificationTemplateBuilder& notification_template_builder, const std::string& profile_id, bool incognito, winui::Notifications::IToastNotification** toast_notification) { *toast_notification = nullptr; ScopedHString ref_class_name = ScopedHString::Create(RuntimeClass_Windows_Data_Xml_Dom_XmlDocument); mswr::ComPtr<IInspectable> inspectable; HRESULT hr = base::win::RoActivateInstance(ref_class_name.get(), &inspectable); if (FAILED(hr)) { LOG(ERROR) << "Unable to activate the XML Document"; return hr; } mswr::ComPtr<winxml::Dom::IXmlDocumentIO> document_io; hr = inspectable.As<winxml::Dom::IXmlDocumentIO>(&document_io); if (FAILED(hr)) { LOG(ERROR) << "Failed to get XmlDocument as IXmlDocumentIO"; return hr; } base::string16 notification_template = notification_template_builder.GetNotificationTemplate(); ScopedHString ref_template = ScopedHString::Create(notification_template); hr = document_io->LoadXml(ref_template.get()); if (FAILED(hr)) { LOG(ERROR) << "Unable to load the template's XML into the document"; return hr; } mswr::ComPtr<winxml::Dom::IXmlDocument> document; hr = document_io.As<winxml::Dom::IXmlDocument>(&document); if (FAILED(hr)) { LOG(ERROR) << "Unable to get as XMLDocument"; return hr; } mswr::ComPtr<winui::Notifications::IToastNotificationFactory> toast_notification_factory; hr = CreateActivationFactory( RuntimeClass_Windows_UI_Notifications_ToastNotification, toast_notification_factory.GetAddressOf()); if (FAILED(hr)) { LOG(ERROR) << "Unable to create the IToastNotificationFactory"; return hr; } hr = toast_notification_factory->CreateToastNotification( document.Get(), toast_notification); if (FAILED(hr)) { LOG(ERROR) << "Unable to create the IToastNotification"; return hr; } winui::Notifications::IToastNotification2* toast2ptr = nullptr; hr = (*toast_notification)->QueryInterface(&toast2ptr); if (FAILED(hr)) { LOG(ERROR) << "Failed to get IToastNotification2 object"; return hr; } mswr::ComPtr<winui::Notifications::IToastNotification2> toast2; toast2.Attach(toast2ptr); // Set the Group and Tag values for the notification, in order to support // closing/replacing notification by tag. Both of these values have a limit // of 64 characters, which is problematic because they are out of our // control and Tag can contain just about anything. Therefore we use a hash // of the Tag value to produce uniqueness that fits within the specified // limits. Although Group is hard-coded, uniqueness is guaranteed through // features providing a sufficiently distinct notification.id(). ScopedHString group = ScopedHString::Create(kGroup); ScopedHString tag = ScopedHString::Create(GetTag(notification.id())); hr = toast2->put_Group(group.get()); if (FAILED(hr)) { LOG(ERROR) << "Failed to set Group"; return hr; } hr = toast2->put_Tag(tag.get()); if (FAILED(hr)) { LOG(ERROR) << "Failed to set Tag"; return hr; } // By default, Windows 10 will always show the notification on screen. // Chrome, however, wants to suppress them if both conditions are true: // 1) Renotify flag is not set. // 2) They are not new (no other notification with same tag is found). if (!notification.renotify()) { std::vector<winui::Notifications::IToastNotification*> notifications; GetNotifications(profile_id, incognito, &notifications); for (winui::Notifications::IToastNotification* notification : notifications) { winui::Notifications::IToastNotification2* t2 = nullptr; HRESULT hr = notification->QueryInterface(&t2); if (FAILED(hr)) continue; HSTRING hstring_group; hr = t2->get_Group(&hstring_group); if (FAILED(hr)) { LOG(ERROR) << "Failed to get group value"; return hr; } ScopedHString scoped_group(hstring_group); HSTRING hstring_tag; hr = t2->get_Tag(&hstring_tag); if (FAILED(hr)) { LOG(ERROR) << "Failed to get tag value"; return hr; } ScopedHString scoped_tag(hstring_tag); if (group.Get() != scoped_group.Get() || tag.Get() != scoped_tag.Get()) continue; // Because it is not a repeat of an toast. hr = toast2->put_SuppressPopup(true); if (FAILED(hr)) { LOG(ERROR) << "Failed to set suppress value"; return hr; } } } return S_OK; } void Display(NotificationHandler::Type notification_type, const std::string& profile_id, bool incognito, std::unique_ptr<message_center::Notification> notification, std::unique_ptr<NotificationCommon::Metadata> metadata) { // TODO(finnur): Move this to a RoInitialized thread, as per // crbug.com/761039. DCHECK(task_runner_->RunsTasksInCurrentSequence()); if (!notifier_.Get() && FAILED(InitializeToastNotifier())) { LOG(ERROR) << "Unable to initialize toast notifier"; return; } NotificationLaunchId launch_id(notification_type, notification->id(), profile_id, incognito, notification->origin_url()); std::unique_ptr<NotificationTemplateBuilder> notification_template = NotificationTemplateBuilder::Build(image_retainer_.get(), launch_id, profile_id, *notification); mswr::ComPtr<winui::Notifications::IToastNotification> toast; HRESULT hr = GetToastNotification(*notification, *notification_template, profile_id, incognito, &toast); if (FAILED(hr)) { LOG(ERROR) << "Unable to get a toast notification"; return; } // Activation via user interaction with the toast is handled in // HandleActivation() by way of the notification_helper. auto dismissed_handler = mswr::Callback<ToastDismissedHandler>( this, &NotificationPlatformBridgeWinImpl::OnDismissed); EventRegistrationToken dismissed_token; hr = toast->add_Dismissed(dismissed_handler.Get(), &dismissed_token); if (FAILED(hr)) { LOG(ERROR) << "Unable to add toast dismissed event handler"; return; } auto failed_handler = mswr::Callback<ToastFailedHandler>( this, &NotificationPlatformBridgeWinImpl::OnFailed); EventRegistrationToken failed_token; hr = toast->add_Failed(failed_handler.Get(), &failed_token); if (FAILED(hr)) { LOG(ERROR) << "Unable to add toast failed event handler"; return; } hr = notifier_->Show(toast.Get()); if (FAILED(hr)) LOG(ERROR) << "Unable to display the notification"; } void Close(const std::string& profile_id, const std::string& notification_id) { DCHECK(task_runner_->RunsTasksInCurrentSequence()); mswr::ComPtr<winui::Notifications::IToastNotificationHistory> history; if (!GetIToastNotificationHistory(&history)) { LOG(ERROR) << "Failed to get IToastNotificationHistory"; return; } ScopedHString application_id = ScopedHString::Create(GetAppId()); ScopedHString group = ScopedHString::Create(kGroup); ScopedHString tag = ScopedHString::Create(GetTag(notification_id)); HRESULT hr = history->RemoveGroupedTagWithId(tag.get(), group.get(), application_id.get()); if (FAILED(hr)) { LOG(ERROR) << "Failed to remove notification with id " << notification_id.c_str(); } } bool GetIToastNotificationHistory( winui::Notifications::IToastNotificationHistory** notification_history) const WARN_UNUSED_RESULT { mswr::ComPtr<winui::Notifications::IToastNotificationManagerStatics> toast_manager; HRESULT hr = CreateActivationFactory( RuntimeClass_Windows_UI_Notifications_ToastNotificationManager, toast_manager.GetAddressOf()); if (FAILED(hr)) { LOG(ERROR) << "Unable to create the ToastNotificationManager"; return false; } mswr::ComPtr<winui::Notifications::IToastNotificationManagerStatics2> toast_manager2; hr = toast_manager .As<winui::Notifications::IToastNotificationManagerStatics2>( &toast_manager2); if (FAILED(hr)) { LOG(ERROR) << "Failed to get IToastNotificationManagerStatics2"; return false; } hr = toast_manager2->get_History(notification_history); if (FAILED(hr)) { LOG(ERROR) << "Failed to get IToastNotificationHistory"; return false; } return true; } void GetDisplayedFromActionCenter( const std::string& profile_id, bool incognito, std::vector<winui::Notifications::IToastNotification*>* notifications) const { mswr::ComPtr<winui::Notifications::IToastNotificationHistory> history; if (!GetIToastNotificationHistory(&history)) { LOG(ERROR) << "Failed to get IToastNotificationHistory"; return; } mswr::ComPtr<winui::Notifications::IToastNotificationHistory2> history2; HRESULT hr = history.As<winui::Notifications::IToastNotificationHistory2>(&history2); if (FAILED(hr)) { LOG(ERROR) << "Failed to get IToastNotificationHistory2"; return; } ScopedHString application_id = ScopedHString::Create(GetAppId()); mswr::ComPtr<winfoundtn::Collections::IVectorView< winui::Notifications::ToastNotification*>> list; hr = history2->GetHistoryWithId(application_id.get(), &list); if (FAILED(hr)) { LOG(ERROR) << "GetHistoryWithId failed"; return; } uint32_t size; hr = list->get_Size(&size); if (FAILED(hr)) { LOG(ERROR) << "History get_Size call failed"; return; } winui::Notifications::IToastNotification* tn; for (uint32_t index = 0; index < size; ++index) { hr = list->GetAt(0U, &tn); if (FAILED(hr)) { LOG(ERROR) << "Failed to get notification " << index << " of " << size; continue; } notifications->push_back(tn); } } void GetNotifications(const std::string& profile_id, bool incognito, std::vector<winui::Notifications::IToastNotification*>* notifications) const { if (!NotificationPlatformBridgeWinImpl::notifications_for_testing_) { GetDisplayedFromActionCenter(profile_id, incognito, notifications); } else { *notifications = *NotificationPlatformBridgeWinImpl::notifications_for_testing_; } } void GetDisplayed(const std::string& profile_id, bool incognito, const GetDisplayedNotificationsCallback& callback) const { // TODO(finnur): Once this function is properly implemented, add DCHECK(UI) // to NotificationPlatformBridgeWin::GetDisplayed. DCHECK(task_runner_->RunsTasksInCurrentSequence()); std::vector<winui::Notifications::IToastNotification*> notifications; GetNotifications(profile_id, incognito, &notifications); auto displayed_notifications = std::make_unique<std::set<std::string>>(); for (winui::Notifications::IToastNotification* notification : notifications) { NotificationLaunchId launch_id(GetNotificationLaunchId(notification)); if (!launch_id.is_valid()) { LOG(ERROR) << "Failed to decode notification ID"; continue; } if (launch_id.profile_id() != profile_id || launch_id.incognito() != incognito) continue; displayed_notifications->insert(launch_id.notification_id()); } content::BrowserThread::PostTask( content::BrowserThread::UI, FROM_HERE, base::BindOnce(callback, std::move(displayed_notifications), /*supports_synchronization=*/true)); } // Test to see if the notification_helper.exe has been registered in the // system, either under HKCU or HKLM. bool IsToastActivatorRegistered() { base::win::RegKey key; base::string16 path = InstallUtil::GetToastActivatorRegistryPath() + L"\\LocalServer32"; HKEY root = install_static::IsSystemInstall() ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; return ERROR_SUCCESS == key.Open(root, path.c_str(), KEY_QUERY_VALUE); } void SetReadyCallback( NotificationPlatformBridge::NotificationBridgeReadyCallback callback) { DCHECK(task_runner_->RunsTasksInCurrentSequence()); std::move(callback).Run( com_functions_initialized_ && IsToastActivatorRegistered() && InstallUtil::IsStartMenuShortcutWithActivatorGuidInstalled()); } void HandleEvent(winui::Notifications::IToastNotification* notification, NotificationCommon::Operation operation, const base::Optional<int>& action_index, const base::Optional<bool>& by_user) { NotificationLaunchId launch_id(GetNotificationLaunchId(notification)); if (!launch_id.is_valid()) { LOG(ERROR) << "Failed to decode launch ID for operation " << operation; return; } content::BrowserThread::PostTask( content::BrowserThread::UI, FROM_HERE, base::BindOnce(&ForwardNotificationOperationOnUiThread, operation, launch_id.notification_type(), launch_id.origin_url(), launch_id.notification_id(), launch_id.profile_id(), launch_id.incognito(), action_index, /*reply=*/base::nullopt, by_user)); } base::Optional<int> ParseActionIndex( winui::Notifications::IToastActivatedEventArgs* args) { HSTRING arguments; HRESULT hr = args->get_Arguments(&arguments); if (FAILED(hr)) return base::nullopt; ScopedHString arguments_scoped(arguments); NotificationLaunchId launch_id(arguments_scoped.GetAsUTF8()); if (!launch_id.is_valid() || launch_id.button_index() < 0) return base::nullopt; return launch_id.button_index(); } void ForwardHandleEventForTesting( NotificationCommon::Operation operation, winui::Notifications::IToastNotification* notification, winui::Notifications::IToastActivatedEventArgs* args, const base::Optional<bool>& by_user) { base::Optional<int> action_index = ParseActionIndex(args); HandleEvent(notification, operation, action_index, by_user); } private: friend class base::RefCountedThreadSafe<NotificationPlatformBridgeWinImpl>; friend class NotificationPlatformBridgeWin; ~NotificationPlatformBridgeWinImpl() = default; base::string16 GetAppId() const { return ShellUtil::GetBrowserModelId(InstallUtil::IsPerUserInstall()); } base::string16 GetTag(const std::string& notification_id) { return base::UintToString16(base::Hash(notification_id)); } NotificationLaunchId GetNotificationLaunchId( winui::Notifications::IToastNotification* notification) const { mswr::ComPtr<winxml::Dom::IXmlDocument> document; HRESULT hr = notification->get_Content(&document); if (FAILED(hr)) { LOG(ERROR) << "Failed to get XML document"; return NotificationLaunchId(); } ScopedHString tag = ScopedHString::Create(kNotificationToastElement); mswr::ComPtr<winxml::Dom::IXmlNodeList> elements; hr = document->GetElementsByTagName(tag.get(), &elements); if (FAILED(hr)) { LOG(ERROR) << "Failed to get <toast> elements from document"; return NotificationLaunchId(); } UINT32 length; hr = elements->get_Length(&length); if (length == 0) { LOG(ERROR) << "No <toast> elements in document."; return NotificationLaunchId(); } mswr::ComPtr<winxml::Dom::IXmlNode> node; hr = elements->Item(0, &node); if (FAILED(hr)) { LOG(ERROR) << "Failed to get first <toast> element"; return NotificationLaunchId(); } mswr::ComPtr<winxml::Dom::IXmlNamedNodeMap> attributes; hr = node->get_Attributes(&attributes); if (FAILED(hr)) { LOG(ERROR) << "Failed to get attributes of <toast>"; return NotificationLaunchId(); } mswr::ComPtr<winxml::Dom::IXmlNode> leaf; ScopedHString id = ScopedHString::Create(kNotificationLaunchAttribute); hr = attributes->GetNamedItem(id.get(), &leaf); if (FAILED(hr)) { LOG(ERROR) << "Failed to get launch attribute of <toast>"; return NotificationLaunchId(); } mswr::ComPtr<winxml::Dom::IXmlNode> child; hr = leaf->get_FirstChild(&child); if (FAILED(hr)) { LOG(ERROR) << "Failed to get content of launch attribute"; return NotificationLaunchId(); } mswr::ComPtr<IInspectable> inspectable; hr = child->get_NodeValue(&inspectable); if (FAILED(hr)) { LOG(ERROR) << "Failed to get node value of launch attribute"; return NotificationLaunchId(); } mswr::ComPtr<winfoundtn::IPropertyValue> property_value; hr = inspectable.As<winfoundtn::IPropertyValue>(&property_value); if (FAILED(hr)) { LOG(ERROR) << "Failed to convert node value of launch attribute"; return NotificationLaunchId(); } HSTRING value_hstring; hr = property_value->GetString(&value_hstring); if (FAILED(hr)) { LOG(ERROR) << "Failed to get string for launch attribute"; return NotificationLaunchId(); } ScopedHString value(value_hstring); return NotificationLaunchId(value.GetAsUTF8()); } HRESULT OnDismissed( winui::Notifications::IToastNotification* notification, winui::Notifications::IToastDismissedEventArgs* arguments) { winui::Notifications::ToastDismissalReason reason; HRESULT hr = arguments->get_Reason(&reason); bool by_user = false; if (SUCCEEDED(hr) && reason == winui::Notifications::ToastDismissalReason_UserCanceled) { by_user = true; } HandleEvent(notification, NotificationCommon::CLOSE, /*action_index=*/base::nullopt, by_user); return S_OK; } HRESULT OnFailed( winui::Notifications::IToastNotification* notification, winui::Notifications::IToastFailedEventArgs* /* arguments */) { // TODO(chengx): Investigate what the correct behavior should be here and // implement it. return S_OK; } HRESULT InitializeToastNotifier() { mswr::ComPtr<winui::Notifications::IToastNotificationManagerStatics> toast_manager; HRESULT hr = CreateActivationFactory( RuntimeClass_Windows_UI_Notifications_ToastNotificationManager, toast_manager.GetAddressOf()); if (FAILED(hr)) { LOG(ERROR) << "Unable to create the ToastNotificationManager"; return hr; } ScopedHString application_id = ScopedHString::Create(GetAppId()); hr = toast_manager->CreateToastNotifierWithId(application_id.get(), &notifier_); if (FAILED(hr)) LOG(ERROR) << "Unable to create the ToastNotifier"; return hr; } static std::vector<ABI::Windows::UI::Notifications::IToastNotification*>* notifications_for_testing_; // Whether the required functions from combase.dll have been loaded. bool com_functions_initialized_; // An object that keeps temp files alive long enough for Windows to pick up. std::unique_ptr<NotificationImageRetainer> image_retainer_; // The task runner this object runs on. scoped_refptr<base::SequencedTaskRunner> task_runner_; // The ToastNotifier to use to communicate with the Action Center. mswr::ComPtr<winui::Notifications::IToastNotifier> notifier_; DISALLOW_COPY_AND_ASSIGN(NotificationPlatformBridgeWinImpl); }; std::vector<ABI::Windows::UI::Notifications::IToastNotification*>* NotificationPlatformBridgeWinImpl::notifications_for_testing_ = nullptr; NotificationPlatformBridgeWin::NotificationPlatformBridgeWin() { task_runner_ = base::CreateSequencedTaskRunnerWithTraits( {base::MayBlock(), base::TaskPriority::USER_BLOCKING}); impl_ = base::MakeRefCounted<NotificationPlatformBridgeWinImpl>(task_runner_); } NotificationPlatformBridgeWin::~NotificationPlatformBridgeWin() = default; void NotificationPlatformBridgeWin::Display( NotificationHandler::Type notification_type, const std::string& profile_id, bool is_incognito, const message_center::Notification& notification, std::unique_ptr<NotificationCommon::Metadata> metadata) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); // Make a deep copy of the notification as its resources cannot safely // be passed between threads. auto notification_copy = message_center::Notification::DeepCopy( notification, /*include_body_image=*/true, /*include_small_image=*/true, /*include_icon_images=*/true); PostTaskToTaskRunnerThread( base::BindOnce(&NotificationPlatformBridgeWinImpl::Display, impl_, notification_type, profile_id, is_incognito, std::move(notification_copy), std::move(metadata))); } void NotificationPlatformBridgeWin::Close(const std::string& profile_id, const std::string& notification_id) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); PostTaskToTaskRunnerThread( base::BindOnce(&NotificationPlatformBridgeWinImpl::Close, impl_, notification_id, profile_id)); } void NotificationPlatformBridgeWin::GetDisplayed( const std::string& profile_id, bool incognito, const GetDisplayedNotificationsCallback& callback) const { PostTaskToTaskRunnerThread( base::BindOnce(&NotificationPlatformBridgeWinImpl::GetDisplayed, impl_, profile_id, incognito, callback)); } void NotificationPlatformBridgeWin::SetReadyCallback( NotificationBridgeReadyCallback callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); PostTaskToTaskRunnerThread( base::BindOnce(&NotificationPlatformBridgeWinImpl::SetReadyCallback, impl_, std::move(callback))); } // static bool NotificationPlatformBridgeWin::HandleActivation() { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); std::string launch_id_str = command_line->GetSwitchValueASCII(switches::kNotificationLaunchId); NotificationLaunchId launch_id(launch_id_str); if (!launch_id.is_valid()) return false; base::Optional<base::string16> reply; base::string16 inline_reply = command_line->GetSwitchValueNative(switches::kNotificationInlineReply); if (!inline_reply.empty()) reply = inline_reply; NotificationCommon::Operation operation = launch_id.is_for_context_menu() ? NotificationCommon::SETTINGS : NotificationCommon::CLICK; ForwardNotificationOperationOnUiThread( operation, launch_id.notification_type(), launch_id.origin_url(), launch_id.notification_id(), launch_id.profile_id(), launch_id.incognito(), launch_id.button_index(), reply, /*by_user=*/true); return true; } // static std::string NotificationPlatformBridgeWin::GetProfileIdFromLaunchId( const std::string& launch_id_str) { NotificationLaunchId launch_id(launch_id_str); return launch_id.is_valid() ? launch_id.profile_id() : std::string(); } // static bool NotificationPlatformBridgeWin::NativeNotificationEnabled() { return base::win::GetVersion() >= base::win::VERSION_WIN10_RS1 && base::FeatureList::IsEnabled(features::kNativeNotifications); } void NotificationPlatformBridgeWin::PostTaskToTaskRunnerThread( base::OnceClosure closure) const { bool success = task_runner_->PostTask(FROM_HERE, std::move(closure)); DCHECK(success); } void NotificationPlatformBridgeWin::ForwardHandleEventForTesting( NotificationCommon::Operation operation, winui::Notifications::IToastNotification* notification, winui::Notifications::IToastActivatedEventArgs* args, const base::Optional<bool>& by_user) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); PostTaskToTaskRunnerThread(base::BindOnce( &NotificationPlatformBridgeWinImpl::ForwardHandleEventForTesting, impl_, operation, base::Unretained(notification), base::Unretained(args), by_user)); } void NotificationPlatformBridgeWin::SetDisplayedNotificationsForTesting( std::vector<ABI::Windows::UI::Notifications::IToastNotification*>* notifications) { NotificationPlatformBridgeWinImpl::notifications_for_testing_ = notifications; } HRESULT NotificationPlatformBridgeWin::GetToastNotificationForTesting( const message_center::Notification& notification, const NotificationTemplateBuilder& notification_template_builder, winui::Notifications::IToastNotification** toast_notification) { return impl_->GetToastNotification( notification, notification_template_builder, "UnusedValue", /*incognito=*/false, toast_notification); }
[ "commit-bot@chromium.org" ]
commit-bot@chromium.org
455c1d127a5d2cf4f3413592e5a46f695928e693
db3205f3f43635d85d7f7f3fa201253f739f6ae9
/GameWindow.h
e8ec382bf74afe731251dcd5f9f73e688cfd0fb1
[]
no_license
qbytm/GameSample
a323969b411f6b46408a18cc0a26257c339e70ea
bc383583de1c2cd9f7ddd09242e6f8ab7b9387fb
refs/heads/master
2020-04-10T13:19:17.832094
2015-06-18T09:46:40
2015-06-18T09:46:40
37,639,474
0
0
null
null
null
null
UTF-8
C++
false
false
494
h
#ifndef GAMEWINDOW_INCLUDE_H #define GAMEWINDOW_INCLUDE_H #include <iostream> #include <string> #include <SDL.h> using namespace std; class GameWindow { public: GameWindow(); ~GameWindow(); bool CreateWindow(string title, int windowWidth, int windowHeight); void Run(void* Start = NULL, void* Update = NULL); SDL_Renderer* GetRenderer(); private: bool quit; SDL_Event e; SDL_Window* window; SDL_Renderer* renderer; void (*Start)(); void (*Update)(); void Close(); }; #endif
[ "qbytm.nj@gmail.com" ]
qbytm.nj@gmail.com
a4a0cf3a95763f3695abe132aad6ea27aa5378cd
3f2c677e911f25653df65549def9e37611307563
/particle_filter.cpp
845f98e959127e075bd3a611bda52287871d9b07
[]
no_license
microwatt/CarND-Kidnapped-Vehicle-Project
f521c52b9094d1bb74ac5ca3f5a3a54525f853e6
c490a9aeed4585cc0eacd5d6bc821aa8327c0f67
refs/heads/master
2021-08-12T01:01:26.671980
2017-11-14T07:44:42
2017-11-14T07:44:42
110,655,720
0
0
null
null
null
null
UTF-8
C++
false
false
10,398
cpp
/* * particle_filter.cpp * * Created on: Dec 12, 2016 * Author: Tiffany Huang */ #include <random> #include <algorithm> #include <iostream> #include <numeric> #include <math.h> #include <iostream> #include <sstream> #include <string> #include <iterator> #include "particle_filter.h" using namespace std; void ParticleFilter::init(double x, double y, double theta, double std[]) { // TODO: Set the number of particles. Initialize all particles to first position (based on estimates of // x, y, theta and their uncertainties from GPS) and all weights to 1. // Add random Gaussian noise to each particle. // NOTE: Consult particle_filter.h for more information about this method (and others in this file). if (!is_initialized) { default_random_engine gen; num_particles = 1; // Create the Gaussian distributions for x, y, theta normal_distribution<double> dist_x(x, std[0]); normal_distribution<double> dist_y(y, std[1]); normal_distribution<double> dist_theta(theta, std[2]); for (int i = 0; i < num_particles; ++i) { Particle init_particle; init_particle.id = i; // init_particle.x = dist_x(gen); // init_particle.y = dist_y(gen); // init_particle.theta = dist_theta(gen); init_particle.weight = 1.0; init_particle.x = x; init_particle.y = y; init_particle.theta = theta; // add init_particle to the vector class particles.push_back(init_particle); } } else is_initialized = true; //cout << " Finished INIT" << endl; //cout << "Weights size" << weights.size() << endl; } void ParticleFilter::prediction(double delta_t, double std_pos[], double velocity, double yaw_rate) { // TODO: Add measurements to each particle and add random Gaussian noise. // NOTE: When adding noise you may find std::normal_distribution and std::default_random_engine useful. // http://en.cppreference.com/w/cpp/numeric/random/normal_distribution // http://www.cplusplus.com/reference/random/default_random_engine/ default_random_engine gen; normal_distribution<double> dist_x(0, std_pos[0]); normal_distribution<double> dist_y(0, std_pos[1]); normal_distribution<double> dist_theta(0, std_pos[2]); for (int i = 0; i < num_particles; i++) { // Calculate updated positions(x, y, theta) based on yaw rate if (yaw_rate < 0.00001) { particles[i].x = particles[i].x + velocity*delta_t*cos(particles[i].theta); particles[i].y = particles[i].y + velocity*delta_t*sin(particles[i].theta); } else { particles[i].x = particles[i].x + (velocity / yaw_rate)*(sin(particles[i].theta + yaw_rate*delta_t) - sin(particles[i].theta)); particles[i].y = particles[i].y + (velocity / yaw_rate)*(cos(particles[i].theta) - cos(particles[i].theta + yaw_rate*delta_t)); particles[i].theta = particles[i].theta + yaw_rate*delta_t; } //particles[i].x += dist_x(gen); //particles[i].y += dist_y(gen); //particles[i].theta += dist_theta(gen); cout << "** PREDICTION (x,y,theta): (" << particles[i].x << ", " << particles[i].y << ", " << particles[i].theta << ")" << endl; } //cout << "Finished Prediction" << endl; } void ParticleFilter::dataAssociation(std::vector<LandmarkObs> predicted, std::vector<LandmarkObs>& observations) { // TODO: Find the predicted measurement that is closest to each observed measurement and assign the // observed measurement to this particular landmark. // NOTE: this method will NOT be called by the grading code. But you will probably find it useful to // implement this method and use it as a helper during the updateWeights phase. } void ParticleFilter::updateWeights(double sensor_range, double std_landmark[], const std::vector<LandmarkObs> &observations, const Map &map_landmarks) { // TODO: Update the weights of each particle using a mult-variate Gaussian distribution. You can read // more about this distribution here: https://en.wikipedia.org/wiki/Multivariate_normal_distribution // NOTE: The observations are given in the VEHICLE'S coordinate system. Your particles are located // according to the MAP'S coordinate system. You will need to transform between the two systems. // Keep in mind that this transformation requires both rotation AND translation (but no scaling). // The following is a good resource for the theory: // https://www.willamette.edu/~gorr/classes/GeneralGraphics/Transforms/transforms2d.htm // and the following is a good resource for the actual equation to implement (look at equation // 3.33 // http://planning.cs.uiuc.edu/node99.html /* A) For each particle 1) Transform particle'sobservations into map coordinates std::vecotr >LandmarkObs> obs_transformation for (landmarksObs observ: observations) LandmarkObs obst; obs_t.id = ; ob_transform.push<obs_t? for each transformed observations calculate distinace to all landmarks for map::single_landmarks landm: map_landkmarks_.list{ dist(landm.x, landm.y, obs_t.ots_t. vector distance.push } find min_elemant and associate the id. (use min_element class) After finding this, calculate proability the particular particles observation saw this particular landmark. particle's total weight is product of probabilities of each observations. */ return; double gauss_norm = (1 / (2 * M_PI*std_landmark[0] * std_landmark[1])); double var_x = 2 * std_landmark[0] * std_landmark[0]; double var_y = 2 * std_landmark[1] * std_landmark[1]; // cout << "STD_LANDMARK (x,y): " << std_landmark[0] << ", " << std_landmark[1] << endl; for (int i = 0; i < particles.size(); i++) { std::vector<int> associations; std::vector<double> sense_x; std::vector<double> sense_y; particles[i].weight = 1.0; // Transform each particle's observations into MAP coordinates LandmarkObs landmark_t; for (int j = 0; j < observations.size(); j++) { landmark_t = observations[j]; LandmarkObs obs_t; obs_t.id = landmark_t.id; obs_t.x = particles[i].x + (cos(particles[i].theta) * landmark_t.x) - (sin(particles[i].theta) * landmark_t.y); obs_t.y = particles[i].y + (sin(particles[i].theta) * landmark_t.x) + (cos(particles[i].theta) * landmark_t.y); // DEBUG //cout << "****** *********************" << endl; // cout << "Observation(x,y): (" << landmark_t.x << ", " << landmark_t.y << ")"; // cout << "Transformed(x,y): (" << obs_t.x << ", " << obs_t.y << ")" << endl; double min_distance = sensor_range; int min_distance_idx = -1; for (int k = 0; k < map_landmarks.landmark_list.size(); k++) { double dists = dist(map_landmarks.landmark_list[k].x_f, map_landmarks.landmark_list[k].y_f, obs_t.x, obs_t.y); if (dists < min_distance) { min_distance = dists; min_distance_idx = k; } } // for (k-loop) if (min_distance_idx != -1) { // cout << "Min Distance IDX: " << min_distance_idx; // cout << " Landmark X: " << map_landmarks.landmark_list[min_distance_idx].x_f; // cout << " Landmark Y: " << map_landmarks.landmark_list[min_distance_idx].y_f << endl; double mu_x = map_landmarks.landmark_list[min_distance_idx].x_f; double mu_y = map_landmarks.landmark_list[min_distance_idx].y_f; // cout << "MU_X: " << mu_x << " MU_Y: " << mu_y << endl; double exponent_term = (obs_t.x - mu_x)*(obs_t.x - mu_x) / var_x + (obs_t.y - mu_y)*(obs_t.y - mu_y) / var_y; double particle_wgt = gauss_norm*exp(-exponent_term); // cout << "Particle wgt: " << particle_wgt; particles[i].weight *= particle_wgt; // cout << " Particle Wgt Prob (MULT): " << particles[i].weight << endl; } else particles[i].weight = 0; associations.push_back(min_distance_idx + 1); sense_x.push_back(obs_t.x); sense_y.push_back(obs_t.y); } // for (j-loop - observations) particles[i] = SetAssociations(particles[i], associations, sense_x, sense_y); //cout << "Final Particle WGT: " << i << " ***: " << particles[i].weight << endl; } // for (i-loop - particles) } void ParticleFilter::resample() { // TODO: Resample particles with replacement with probability proportional to their weight. // NOTE: You may find std::discrete_distribution helpful here. // http://en.cppreference.com/w/cpp/numeric/random/discrete_distribution return; default_random_engine gen; vector<double> weights; // cout << "***** Resample function" << endl; for (int i = 0; i < num_particles; i++) { weights.push_back(particles[i].weight); //cout << "****: " << particles[i].weight << endl; } discrete_distribution<int> distribution(weights.begin(), weights.end()); std::vector<Particle> resample_particles; for (int i = 0; i < num_particles; i++) { resample_particles.push_back(particles[distribution(gen)]); } particles = resample_particles; } Particle ParticleFilter::SetAssociations(Particle particle, std::vector<int> associations, std::vector<double> sense_x, std::vector<double> sense_y) { //particle: the particle to assign each listed association, and association's (x,y) world coordinates mapping to // associations: The landmark id that goes along with each listed association // sense_x: the associations x mapping already converted to world coordinates // sense_y: the associations y mapping already converted to world coordinates //Clear the previous associations particle.associations.clear(); particle.sense_x.clear(); particle.sense_y.clear(); particle.associations= associations; particle.sense_x = sense_x; particle.sense_y = sense_y; return particle; } string ParticleFilter::getAssociations(Particle best) { vector<int> v = best.associations; stringstream ss; copy( v.begin(), v.end(), ostream_iterator<int>(ss, " ")); string s = ss.str(); s = s.substr(0, s.length()-1); // get rid of the trailing space return s; } string ParticleFilter::getSenseX(Particle best) { vector<double> v = best.sense_x; stringstream ss; copy( v.begin(), v.end(), ostream_iterator<float>(ss, " ")); string s = ss.str(); s = s.substr(0, s.length()-1); // get rid of the trailing space return s; } string ParticleFilter::getSenseY(Particle best) { vector<double> v = best.sense_y; stringstream ss; copy( v.begin(), v.end(), ostream_iterator<float>(ss, " ")); string s = ss.str(); s = s.substr(0, s.length()-1); // get rid of the trailing space return s; }
[ "microwatt@users.noreply.github.com" ]
microwatt@users.noreply.github.com
cd2c9324fb6d7c6050037d1afe7b34d09382381a
1c8f1e943b0ee1273bf168894af9c210a76f4ce5
/AlgorithmDesignAndAnalysis(2019)/2.4 白给题.cpp
0690fca94bd2029e9c006ab6d57241a48b9bb87b
[]
no_license
jifengye/personal-Code
0ef3013637bdb84e15f3228eb4422ff5692e31e7
ab563a28ab6e945dd7b37603542b2d3c9b34a470
refs/heads/master
2020-05-02T04:19:44.762804
2019-12-28T15:47:52
2019-12-28T15:47:52
177,746,687
0
0
null
null
null
null
GB18030
C++
false
false
1,684
cpp
/* 算法设计与分析 2.4 白给题 ★题目描述 给定N个自然数,你需要选择M个,使得M个数中两两之间的差的绝对值的最小值尽可能大,求这个最大值。 ★输入格式 第一行两个空格隔开的正整数N,M,表示自然数个数和要选的数的个数。 接下来一行为N个空格隔开的给定自然数。 ★输出格式 一个整数。 ★样例输入 3 2 1 2 3 ★样例输出 2 */ /* 先对数列进行排序 然后保存这个序列相邻两个数的差值,组成差值序列 这个时候就变成一道类型题了, 现在就是要通过相邻的两个差值合并,使最后余下的m-1个的差值中最小值尽可能的大 设置一个变量 间隔res 设置这个 间隔res 从(max-min)/m开始减小到为1 一旦根据这个间隔可以在差值序列中找到对应的数列,那么就说明这个间隔为答案 但是这个章节又是讲二分 所以,[0,max_res]间找间隔res应该使用二分 */ #include<bits/stdc++.h> using namespace std; int n,m; int a[200005]; int b[200005]; int fun(int res){ int cnt=0, k=1; for(int i=1; i<n; ++i){ if(res+a[cnt]<=a[i]){ cnt=i; k++; } if(k>=m) return 1; } return 0; } int df(int L, int R){ // printf(" **(%d %d %d)\n", L, (L+R)/2, R); if(L>R) return 0; int mid = (L+R)/2; if(fun(mid)) return max(df(mid+1, R), mid); else return df(L, mid-1); } int main(){ scanf("%d%d",&n, &m); for(int i=0; i<n; ++i){ scanf("%d", &a[i]); } sort(a, a+n); printf("%d\n",df(0, (a[n-1]-a[0])/(m-1) )); } /* 3 2 1 2 3 10 8 1 10 2 3 4 9 8 7 6 5 10 4 1 10 2 3 3 3 3 3 3 3 8 8 3 4 3 3 3 3 3 3 6 3 1 11 44 33 99 100 */
[ "2509050464@qq.com" ]
2509050464@qq.com
fb7755c934a94f9b987884dafe1627c75ac52da5
38c10c01007624cd2056884f25e0d6ab85442194
/sql/mojo/sql_test_base.cc
107411342bf8fe51f2446e9ea95a3a79890901b0
[ "BSD-3-Clause" ]
permissive
zenoalbisser/chromium
6ecf37b6c030c84f1b26282bc4ef95769c62a9b2
e71f21b9b4b9b839f5093301974a45545dad2691
refs/heads/master
2022-12-25T14:23:18.568575
2016-07-14T21:49:52
2016-07-23T08:02:51
63,980,627
0
2
BSD-3-Clause
2022-12-12T12:43:41
2016-07-22T20:14:04
null
UTF-8
C++
false
false
4,882
cc
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "sql/mojo/sql_test_base.h" #include "mojo/application/public/cpp/application_impl.h" #include "mojo/util/capture_util.h" #include "sql/mojo/mojo_vfs.h" #include "sql/test/test_helpers.h" using mojo::Capture; namespace sql { SQLTestBase::SQLTestBase() : binding_(this) { } SQLTestBase::~SQLTestBase() { } base::FilePath SQLTestBase::db_path() { return base::FilePath(FILE_PATH_LITERAL("SQLTest.db")); } sql::Connection& SQLTestBase::db() { return db_; } bool SQLTestBase::Reopen() { db_.Close(); return db_.Open(db_path()); } bool SQLTestBase::GetPathExists(const base::FilePath& path) { filesystem::FileError error = filesystem::FILE_ERROR_FAILED; bool exists = false; vfs_->GetDirectory()->Exists(path.AsUTF8Unsafe(), Capture(&error, &exists)); vfs_->GetDirectory().WaitForIncomingResponse(); if (error != filesystem::FILE_ERROR_OK) return false; return exists; } bool SQLTestBase::CorruptSizeInHeaderOfDB() { // See http://www.sqlite.org/fileformat.html#database_header const size_t kHeaderSize = 100; mojo::Array<uint8_t> header; filesystem::FileError error = filesystem::FILE_ERROR_FAILED; filesystem::FilePtr file_ptr; vfs_->GetDirectory()->OpenFile( mojo::String(db_path().AsUTF8Unsafe()), GetProxy(&file_ptr), filesystem::kFlagRead | filesystem::kFlagWrite | filesystem::kFlagOpenAlways, Capture(&error)); vfs_->GetDirectory().WaitForIncomingResponse(); if (error != filesystem::FILE_ERROR_OK) return false; file_ptr->Read(kHeaderSize, 0, filesystem::WHENCE_FROM_BEGIN, Capture(&error, &header)); file_ptr.WaitForIncomingResponse(); if (error != filesystem::FILE_ERROR_OK) return false; filesystem::FileInformationPtr info; file_ptr->Stat(Capture(&error, &info)); file_ptr.WaitForIncomingResponse(); if (error != filesystem::FILE_ERROR_OK) return false; int64_t db_size = info->size; test::CorruptSizeInHeaderMemory(&header.front(), db_size); uint32_t num_bytes_written = 0; file_ptr->Write(header.Pass(), 0, filesystem::WHENCE_FROM_BEGIN, Capture(&error, &num_bytes_written)); file_ptr.WaitForIncomingResponse(); if (error != filesystem::FILE_ERROR_OK) return false; if (num_bytes_written != kHeaderSize) return false; return true; } void SQLTestBase::WriteJunkToDatabase(WriteJunkType type) { uint32_t flags = 0; if (type == TYPE_OVERWRITE_AND_TRUNCATE) flags = filesystem::kFlagWrite | filesystem::kFlagCreate; else flags = filesystem::kFlagWrite | filesystem::kFlagOpen; filesystem::FileError error = filesystem::FILE_ERROR_FAILED; filesystem::FilePtr file_ptr; vfs_->GetDirectory()->OpenFile( mojo::String(db_path().AsUTF8Unsafe()), GetProxy(&file_ptr), flags, Capture(&error)); vfs_->GetDirectory().WaitForIncomingResponse(); if (error != filesystem::FILE_ERROR_OK) return; const char* kJunk = "Now is the winter of our discontent."; mojo::Array<uint8_t> data(strlen(kJunk)); memcpy(&data.front(), kJunk, strlen(kJunk)); uint32_t num_bytes_written = 0; file_ptr->Write(data.Pass(), 0, filesystem::WHENCE_FROM_BEGIN, Capture(&error, &num_bytes_written)); file_ptr.WaitForIncomingResponse(); } void SQLTestBase::TruncateDatabase() { filesystem::FileError error = filesystem::FILE_ERROR_FAILED; filesystem::FilePtr file_ptr; vfs_->GetDirectory()->OpenFile( mojo::String(db_path().AsUTF8Unsafe()), GetProxy(&file_ptr), filesystem::kFlagWrite | filesystem::kFlagOpen, Capture(&error)); vfs_->GetDirectory().WaitForIncomingResponse(); if (error != filesystem::FILE_ERROR_OK) return; file_ptr->Truncate(0, Capture(&error)); file_ptr.WaitForIncomingResponse(); ASSERT_EQ(filesystem::FILE_ERROR_OK, error); } void SQLTestBase::SetUp() { ApplicationTestBase::SetUp(); mojo::URLRequestPtr request(mojo::URLRequest::New()); request->url = mojo::String::From("mojo:filesystem"); application_impl()->ConnectToService(request.Pass(), &files_); filesystem::FileSystemClientPtr client; binding_.Bind(GetProxy(&client)); filesystem::FileError error = filesystem::FILE_ERROR_FAILED; filesystem::DirectoryPtr directory; files()->OpenFileSystem("temp", GetProxy(&directory), client.Pass(), Capture(&error)); ASSERT_TRUE(files().WaitForIncomingResponse()); ASSERT_EQ(filesystem::FILE_ERROR_OK, error); vfs_.reset(new ScopedMojoFilesystemVFS(directory.Pass())); ASSERT_TRUE(db_.Open(db_path())); } void SQLTestBase::TearDown() { db_.Close(); vfs_.reset(); ApplicationTestBase::TearDown(); } void SQLTestBase::OnFileSystemShutdown() { } } // namespace sql
[ "zeno.albisser@hemispherian.com" ]
zeno.albisser@hemispherian.com
cd7d06d27e3ba0ba4ee680cfd6f256e2c4659f51
c26631487f8e5c10b80d4f96710fed4309cdd354
/Dependence/PythonQt/generated_cpp/com_trolltech_qt_gui/com_trolltech_qt_gui10.cpp
eb4e34a316467006c707eff8cd6149064c8cbc4d
[]
no_license
ccdump/PebbleEngine
975fe39f80dc0a5b73257f528d459510fb69b23b
a7360989a204093dcbe4e70afa0d5a157284f296
refs/heads/master
2021-01-19T21:48:19.379256
2013-05-29T12:03:00
2013-05-29T12:03:00
null
0
0
null
null
null
null
UTF-8
C++
false
false
535,837
cpp
#include "com_trolltech_qt_gui10.h" #include <PythonQtConversion.h> #include <PythonQtMethodInfo.h> #include <PythonQtSignalReceiver.h> #include <QIcon> #include <QMessageBox> #include <QVariant> #include <qabstractbutton.h> #include <qabstractitemdelegate.h> #include <qabstractitemmodel.h> #include <qaction.h> #include <qactiongroup.h> #include <qapplication.h> #include <qbitmap.h> #include <qboxlayout.h> #include <qbrush.h> #include <qbytearray.h> #include <qcoreevent.h> #include <qcursor.h> #include <qdatastream.h> #include <qevent.h> #include <qfont.h> #include <qgraphicseffect.h> #include <qgraphicsproxywidget.h> #include <qgraphicswidget.h> #include <qheaderview.h> #include <qicon.h> #include <qinputcontext.h> #include <qitemselectionmodel.h> #include <qkeysequence.h> #include <qlayout.h> #include <qlayoutitem.h> #include <qline.h> #include <qlist.h> #include <qlocale.h> #include <qmargins.h> #include <qmatrix.h> #include <qmatrix4x4.h> #include <qmenu.h> #include <qmimedata.h> #include <qobject.h> #include <qpaintdevice.h> #include <qpaintengine.h> #include <qpainter.h> #include <qpainterpath.h> #include <qpalette.h> #include <qpixmap.h> #include <qpoint.h> #include <qpolygon.h> #include <qrect.h> #include <qregion.h> #include <qscrollbar.h> #include <qsize.h> #include <qsizepolicy.h> #include <qstringlist.h> #include <qstyle.h> #include <qstyleoption.h> #include <qtransform.h> #include <qtreeview.h> #include <qtreewidget.h> #include <qundogroup.h> #include <qundostack.h> #include <qundoview.h> #include <qvalidator.h> #include <qvector2d.h> #include <qvector3d.h> #include <qvector4d.h> #include <qwidget.h> #include <qwidgetaction.h> #include <qwindowsstyle.h> #include <qwizard.h> #include <qworkspace.h> QFont PythonQtWrapper_QToolTip::static_QToolTip_font() { return (QToolTip::font()); } void PythonQtWrapper_QToolTip::static_QToolTip_hideText() { (QToolTip::hideText()); } bool PythonQtWrapper_QToolTip::static_QToolTip_isVisible() { return (QToolTip::isVisible()); } QPalette PythonQtWrapper_QToolTip::static_QToolTip_palette() { return (QToolTip::palette()); } void PythonQtWrapper_QToolTip::static_QToolTip_setFont(const QFont& arg__1) { (QToolTip::setFont(arg__1)); } void PythonQtWrapper_QToolTip::static_QToolTip_setPalette(const QPalette& arg__1) { (QToolTip::setPalette(arg__1)); } void PythonQtWrapper_QToolTip::static_QToolTip_showText(const QPoint& pos, const QString& text, QWidget* w) { (QToolTip::showText(pos, text, w)); } void PythonQtWrapper_QToolTip::static_QToolTip_showText(const QPoint& pos, const QString& text, QWidget* w, const QRect& rect) { (QToolTip::showText(pos, text, w, rect)); } QString PythonQtWrapper_QToolTip::static_QToolTip_text() { return (QToolTip::text()); } QTouchEvent* PythonQtWrapper_QTouchEvent::new_QTouchEvent(QEvent::Type eventType, QTouchEvent::DeviceType deviceType, Qt::KeyboardModifiers modifiers, Qt::TouchPointStates touchPointStates, const QList<QTouchEvent::TouchPoint >& touchPoints) { return new PythonQtShell_QTouchEvent(eventType, deviceType, modifiers, touchPointStates, touchPoints); } QTouchEvent::DeviceType PythonQtWrapper_QTouchEvent::deviceType(QTouchEvent* theWrappedObject) const { return ( theWrappedObject->deviceType()); } void PythonQtWrapper_QTouchEvent::setDeviceType(QTouchEvent* theWrappedObject, QTouchEvent::DeviceType adeviceType) { ( theWrappedObject->setDeviceType(adeviceType)); } void PythonQtWrapper_QTouchEvent::setTouchPointStates(QTouchEvent* theWrappedObject, Qt::TouchPointStates aTouchPointStates) { ( theWrappedObject->setTouchPointStates(aTouchPointStates)); } void PythonQtWrapper_QTouchEvent::setTouchPoints(QTouchEvent* theWrappedObject, const QList<QTouchEvent::TouchPoint >& atouchPoints) { ( theWrappedObject->setTouchPoints(atouchPoints)); } void PythonQtWrapper_QTouchEvent::setWidget(QTouchEvent* theWrappedObject, QWidget* awidget) { ( theWrappedObject->setWidget(awidget)); } Qt::TouchPointStates PythonQtWrapper_QTouchEvent::touchPointStates(QTouchEvent* theWrappedObject) const { return ( theWrappedObject->touchPointStates()); } const QList<QTouchEvent::TouchPoint >* PythonQtWrapper_QTouchEvent::touchPoints(QTouchEvent* theWrappedObject) const { return &( theWrappedObject->touchPoints()); } QWidget* PythonQtWrapper_QTouchEvent::widget(QTouchEvent* theWrappedObject) const { return ( theWrappedObject->widget()); } QTouchEvent::TouchPoint* PythonQtWrapper_QTouchEvent_TouchPoint::new_QTouchEvent_TouchPoint(const QTouchEvent::TouchPoint& other) { return new QTouchEvent::TouchPoint(other); } QTouchEvent::TouchPoint* PythonQtWrapper_QTouchEvent_TouchPoint::new_QTouchEvent_TouchPoint(int id) { return new QTouchEvent::TouchPoint(id); } int PythonQtWrapper_QTouchEvent_TouchPoint::id(QTouchEvent::TouchPoint* theWrappedObject) const { return ( theWrappedObject->id()); } bool PythonQtWrapper_QTouchEvent_TouchPoint::isPrimary(QTouchEvent::TouchPoint* theWrappedObject) const { return ( theWrappedObject->isPrimary()); } QPointF PythonQtWrapper_QTouchEvent_TouchPoint::lastNormalizedPos(QTouchEvent::TouchPoint* theWrappedObject) const { return ( theWrappedObject->lastNormalizedPos()); } QPointF PythonQtWrapper_QTouchEvent_TouchPoint::lastPos(QTouchEvent::TouchPoint* theWrappedObject) const { return ( theWrappedObject->lastPos()); } QPointF PythonQtWrapper_QTouchEvent_TouchPoint::lastScenePos(QTouchEvent::TouchPoint* theWrappedObject) const { return ( theWrappedObject->lastScenePos()); } QPointF PythonQtWrapper_QTouchEvent_TouchPoint::lastScreenPos(QTouchEvent::TouchPoint* theWrappedObject) const { return ( theWrappedObject->lastScreenPos()); } QPointF PythonQtWrapper_QTouchEvent_TouchPoint::normalizedPos(QTouchEvent::TouchPoint* theWrappedObject) const { return ( theWrappedObject->normalizedPos()); } QTouchEvent::TouchPoint* PythonQtWrapper_QTouchEvent_TouchPoint::operator_assign(QTouchEvent::TouchPoint* theWrappedObject, const QTouchEvent::TouchPoint& other) { return &( (*theWrappedObject)= other); } QPointF PythonQtWrapper_QTouchEvent_TouchPoint::pos(QTouchEvent::TouchPoint* theWrappedObject) const { return ( theWrappedObject->pos()); } qreal PythonQtWrapper_QTouchEvent_TouchPoint::pressure(QTouchEvent::TouchPoint* theWrappedObject) const { return ( theWrappedObject->pressure()); } QRectF PythonQtWrapper_QTouchEvent_TouchPoint::rect(QTouchEvent::TouchPoint* theWrappedObject) const { return ( theWrappedObject->rect()); } QPointF PythonQtWrapper_QTouchEvent_TouchPoint::scenePos(QTouchEvent::TouchPoint* theWrappedObject) const { return ( theWrappedObject->scenePos()); } QRectF PythonQtWrapper_QTouchEvent_TouchPoint::sceneRect(QTouchEvent::TouchPoint* theWrappedObject) const { return ( theWrappedObject->sceneRect()); } QPointF PythonQtWrapper_QTouchEvent_TouchPoint::screenPos(QTouchEvent::TouchPoint* theWrappedObject) const { return ( theWrappedObject->screenPos()); } QRectF PythonQtWrapper_QTouchEvent_TouchPoint::screenRect(QTouchEvent::TouchPoint* theWrappedObject) const { return ( theWrappedObject->screenRect()); } void PythonQtWrapper_QTouchEvent_TouchPoint::setId(QTouchEvent::TouchPoint* theWrappedObject, int id) { ( theWrappedObject->setId(id)); } void PythonQtWrapper_QTouchEvent_TouchPoint::setLastNormalizedPos(QTouchEvent::TouchPoint* theWrappedObject, const QPointF& lastNormalizedPos) { ( theWrappedObject->setLastNormalizedPos(lastNormalizedPos)); } void PythonQtWrapper_QTouchEvent_TouchPoint::setLastPos(QTouchEvent::TouchPoint* theWrappedObject, const QPointF& lastPos) { ( theWrappedObject->setLastPos(lastPos)); } void PythonQtWrapper_QTouchEvent_TouchPoint::setLastScenePos(QTouchEvent::TouchPoint* theWrappedObject, const QPointF& lastScenePos) { ( theWrappedObject->setLastScenePos(lastScenePos)); } void PythonQtWrapper_QTouchEvent_TouchPoint::setLastScreenPos(QTouchEvent::TouchPoint* theWrappedObject, const QPointF& lastScreenPos) { ( theWrappedObject->setLastScreenPos(lastScreenPos)); } void PythonQtWrapper_QTouchEvent_TouchPoint::setNormalizedPos(QTouchEvent::TouchPoint* theWrappedObject, const QPointF& normalizedPos) { ( theWrappedObject->setNormalizedPos(normalizedPos)); } void PythonQtWrapper_QTouchEvent_TouchPoint::setPos(QTouchEvent::TouchPoint* theWrappedObject, const QPointF& pos) { ( theWrappedObject->setPos(pos)); } void PythonQtWrapper_QTouchEvent_TouchPoint::setPressure(QTouchEvent::TouchPoint* theWrappedObject, qreal pressure) { ( theWrappedObject->setPressure(pressure)); } void PythonQtWrapper_QTouchEvent_TouchPoint::setRect(QTouchEvent::TouchPoint* theWrappedObject, const QRectF& rect) { ( theWrappedObject->setRect(rect)); } void PythonQtWrapper_QTouchEvent_TouchPoint::setScenePos(QTouchEvent::TouchPoint* theWrappedObject, const QPointF& scenePos) { ( theWrappedObject->setScenePos(scenePos)); } void PythonQtWrapper_QTouchEvent_TouchPoint::setSceneRect(QTouchEvent::TouchPoint* theWrappedObject, const QRectF& sceneRect) { ( theWrappedObject->setSceneRect(sceneRect)); } void PythonQtWrapper_QTouchEvent_TouchPoint::setScreenPos(QTouchEvent::TouchPoint* theWrappedObject, const QPointF& screenPos) { ( theWrappedObject->setScreenPos(screenPos)); } void PythonQtWrapper_QTouchEvent_TouchPoint::setScreenRect(QTouchEvent::TouchPoint* theWrappedObject, const QRectF& screenRect) { ( theWrappedObject->setScreenRect(screenRect)); } void PythonQtWrapper_QTouchEvent_TouchPoint::setStartNormalizedPos(QTouchEvent::TouchPoint* theWrappedObject, const QPointF& startNormalizedPos) { ( theWrappedObject->setStartNormalizedPos(startNormalizedPos)); } void PythonQtWrapper_QTouchEvent_TouchPoint::setStartPos(QTouchEvent::TouchPoint* theWrappedObject, const QPointF& startPos) { ( theWrappedObject->setStartPos(startPos)); } void PythonQtWrapper_QTouchEvent_TouchPoint::setStartScenePos(QTouchEvent::TouchPoint* theWrappedObject, const QPointF& startScenePos) { ( theWrappedObject->setStartScenePos(startScenePos)); } void PythonQtWrapper_QTouchEvent_TouchPoint::setStartScreenPos(QTouchEvent::TouchPoint* theWrappedObject, const QPointF& startScreenPos) { ( theWrappedObject->setStartScreenPos(startScreenPos)); } void PythonQtWrapper_QTouchEvent_TouchPoint::setState(QTouchEvent::TouchPoint* theWrappedObject, Qt::TouchPointStates state) { ( theWrappedObject->setState(state)); } QPointF PythonQtWrapper_QTouchEvent_TouchPoint::startNormalizedPos(QTouchEvent::TouchPoint* theWrappedObject) const { return ( theWrappedObject->startNormalizedPos()); } QPointF PythonQtWrapper_QTouchEvent_TouchPoint::startPos(QTouchEvent::TouchPoint* theWrappedObject) const { return ( theWrappedObject->startPos()); } QPointF PythonQtWrapper_QTouchEvent_TouchPoint::startScenePos(QTouchEvent::TouchPoint* theWrappedObject) const { return ( theWrappedObject->startScenePos()); } QPointF PythonQtWrapper_QTouchEvent_TouchPoint::startScreenPos(QTouchEvent::TouchPoint* theWrappedObject) const { return ( theWrappedObject->startScreenPos()); } Qt::TouchPointState PythonQtWrapper_QTouchEvent_TouchPoint::state(QTouchEvent::TouchPoint* theWrappedObject) const { return ( theWrappedObject->state()); } QTransform* PythonQtWrapper_QTransform::new_QTransform() { return new QTransform(); } QTransform* PythonQtWrapper_QTransform::new_QTransform(const QMatrix& mtx) { return new QTransform(mtx); } QTransform* PythonQtWrapper_QTransform::new_QTransform(qreal h11, qreal h12, qreal h13, qreal h21, qreal h22, qreal h23, qreal h31, qreal h32, qreal h33) { return new QTransform(h11, h12, h13, h21, h22, h23, h31, h32, h33); } QTransform* PythonQtWrapper_QTransform::new_QTransform(qreal h11, qreal h12, qreal h21, qreal h22, qreal dx, qreal dy) { return new QTransform(h11, h12, h21, h22, dx, dy); } QTransform PythonQtWrapper_QTransform::adjoint(QTransform* theWrappedObject) const { return ( theWrappedObject->adjoint()); } qreal PythonQtWrapper_QTransform::det(QTransform* theWrappedObject) const { return ( theWrappedObject->det()); } qreal PythonQtWrapper_QTransform::determinant(QTransform* theWrappedObject) const { return ( theWrappedObject->determinant()); } qreal PythonQtWrapper_QTransform::dx(QTransform* theWrappedObject) const { return ( theWrappedObject->dx()); } qreal PythonQtWrapper_QTransform::dy(QTransform* theWrappedObject) const { return ( theWrappedObject->dy()); } QTransform PythonQtWrapper_QTransform::static_QTransform_fromScale(qreal dx, qreal dy) { return (QTransform::fromScale(dx, dy)); } QTransform PythonQtWrapper_QTransform::static_QTransform_fromTranslate(qreal dx, qreal dy) { return (QTransform::fromTranslate(dx, dy)); } QTransform PythonQtWrapper_QTransform::inverted(QTransform* theWrappedObject, bool* invertible) const { return ( theWrappedObject->inverted(invertible)); } bool PythonQtWrapper_QTransform::isAffine(QTransform* theWrappedObject) const { return ( theWrappedObject->isAffine()); } bool PythonQtWrapper_QTransform::isIdentity(QTransform* theWrappedObject) const { return ( theWrappedObject->isIdentity()); } bool PythonQtWrapper_QTransform::isInvertible(QTransform* theWrappedObject) const { return ( theWrappedObject->isInvertible()); } bool PythonQtWrapper_QTransform::isRotating(QTransform* theWrappedObject) const { return ( theWrappedObject->isRotating()); } bool PythonQtWrapper_QTransform::isScaling(QTransform* theWrappedObject) const { return ( theWrappedObject->isScaling()); } bool PythonQtWrapper_QTransform::isTranslating(QTransform* theWrappedObject) const { return ( theWrappedObject->isTranslating()); } qreal PythonQtWrapper_QTransform::m11(QTransform* theWrappedObject) const { return ( theWrappedObject->m11()); } qreal PythonQtWrapper_QTransform::m12(QTransform* theWrappedObject) const { return ( theWrappedObject->m12()); } qreal PythonQtWrapper_QTransform::m13(QTransform* theWrappedObject) const { return ( theWrappedObject->m13()); } qreal PythonQtWrapper_QTransform::m21(QTransform* theWrappedObject) const { return ( theWrappedObject->m21()); } qreal PythonQtWrapper_QTransform::m22(QTransform* theWrappedObject) const { return ( theWrappedObject->m22()); } qreal PythonQtWrapper_QTransform::m23(QTransform* theWrappedObject) const { return ( theWrappedObject->m23()); } qreal PythonQtWrapper_QTransform::m31(QTransform* theWrappedObject) const { return ( theWrappedObject->m31()); } qreal PythonQtWrapper_QTransform::m32(QTransform* theWrappedObject) const { return ( theWrappedObject->m32()); } qreal PythonQtWrapper_QTransform::m33(QTransform* theWrappedObject) const { return ( theWrappedObject->m33()); } QLine PythonQtWrapper_QTransform::map(QTransform* theWrappedObject, const QLine& l) const { return ( theWrappedObject->map(l)); } QLineF PythonQtWrapper_QTransform::map(QTransform* theWrappedObject, const QLineF& l) const { return ( theWrappedObject->map(l)); } QPainterPath PythonQtWrapper_QTransform::map(QTransform* theWrappedObject, const QPainterPath& p) const { return ( theWrappedObject->map(p)); } QPoint PythonQtWrapper_QTransform::map(QTransform* theWrappedObject, const QPoint& p) const { return ( theWrappedObject->map(p)); } QPointF PythonQtWrapper_QTransform::map(QTransform* theWrappedObject, const QPointF& p) const { return ( theWrappedObject->map(p)); } QPolygon PythonQtWrapper_QTransform::map(QTransform* theWrappedObject, const QPolygon& a) const { return ( theWrappedObject->map(a)); } QPolygonF PythonQtWrapper_QTransform::map(QTransform* theWrappedObject, const QPolygonF& a) const { return ( theWrappedObject->map(a)); } QRegion PythonQtWrapper_QTransform::map(QTransform* theWrappedObject, const QRegion& r) const { return ( theWrappedObject->map(r)); } void PythonQtWrapper_QTransform::map(QTransform* theWrappedObject, qreal x, qreal y, qreal* tx, qreal* ty) const { ( theWrappedObject->map(x, y, tx, ty)); } QRect PythonQtWrapper_QTransform::mapRect(QTransform* theWrappedObject, const QRect& arg__1) const { return ( theWrappedObject->mapRect(arg__1)); } QRectF PythonQtWrapper_QTransform::mapRect(QTransform* theWrappedObject, const QRectF& arg__1) const { return ( theWrappedObject->mapRect(arg__1)); } QPolygon PythonQtWrapper_QTransform::mapToPolygon(QTransform* theWrappedObject, const QRect& r) const { return ( theWrappedObject->mapToPolygon(r)); } bool PythonQtWrapper_QTransform::__ne__(QTransform* theWrappedObject, const QTransform& arg__1) const { return ( (*theWrappedObject)!= arg__1); } QTransform PythonQtWrapper_QTransform::multiplied(QTransform* theWrappedObject, const QTransform& o) const { return ( (*theWrappedObject)* o); } QTransform PythonQtWrapper_QTransform::__mul__(QTransform* theWrappedObject, qreal n) { return ( (*theWrappedObject)* n); } QTransform* PythonQtWrapper_QTransform::__imul__(QTransform* theWrappedObject, const QTransform& arg__1) { return &( (*theWrappedObject)*= arg__1); } QTransform* PythonQtWrapper_QTransform::__imul__(QTransform* theWrappedObject, qreal div) { return &( (*theWrappedObject)*= div); } QTransform PythonQtWrapper_QTransform::__add__(QTransform* theWrappedObject, qreal n) { return ( (*theWrappedObject)+ n); } QTransform* PythonQtWrapper_QTransform::__iadd__(QTransform* theWrappedObject, qreal div) { return &( (*theWrappedObject)+= div); } QTransform PythonQtWrapper_QTransform::__sub__(QTransform* theWrappedObject, qreal n) { return ( (*theWrappedObject)- n); } QTransform* PythonQtWrapper_QTransform::__isub__(QTransform* theWrappedObject, qreal div) { return &( (*theWrappedObject)-= div); } QTransform PythonQtWrapper_QTransform::__div__(QTransform* theWrappedObject, qreal n) { return ( (*theWrappedObject)/ n); } QTransform* PythonQtWrapper_QTransform::__idiv__(QTransform* theWrappedObject, qreal div) { return &( (*theWrappedObject)/= div); } void PythonQtWrapper_QTransform::writeTo(QTransform* theWrappedObject, QDataStream& arg__1) { arg__1 << (*theWrappedObject); } bool PythonQtWrapper_QTransform::__eq__(QTransform* theWrappedObject, const QTransform& arg__1) const { return ( (*theWrappedObject)== arg__1); } void PythonQtWrapper_QTransform::readFrom(QTransform* theWrappedObject, QDataStream& arg__1) { arg__1 >> (*theWrappedObject); } bool PythonQtWrapper_QTransform::static_QTransform_quadToQuad(const QPolygonF& one, const QPolygonF& two, QTransform& result) { return (QTransform::quadToQuad(one, two, result)); } bool PythonQtWrapper_QTransform::static_QTransform_quadToSquare(const QPolygonF& quad, QTransform& result) { return (QTransform::quadToSquare(quad, result)); } void PythonQtWrapper_QTransform::reset(QTransform* theWrappedObject) { ( theWrappedObject->reset()); } QTransform* PythonQtWrapper_QTransform::rotate(QTransform* theWrappedObject, qreal a, Qt::Axis axis) { return &( theWrappedObject->rotate(a, axis)); } QTransform* PythonQtWrapper_QTransform::rotateRadians(QTransform* theWrappedObject, qreal a, Qt::Axis axis) { return &( theWrappedObject->rotateRadians(a, axis)); } QTransform* PythonQtWrapper_QTransform::scale(QTransform* theWrappedObject, qreal sx, qreal sy) { return &( theWrappedObject->scale(sx, sy)); } void PythonQtWrapper_QTransform::setMatrix(QTransform* theWrappedObject, qreal m11, qreal m12, qreal m13, qreal m21, qreal m22, qreal m23, qreal m31, qreal m32, qreal m33) { ( theWrappedObject->setMatrix(m11, m12, m13, m21, m22, m23, m31, m32, m33)); } QTransform* PythonQtWrapper_QTransform::shear(QTransform* theWrappedObject, qreal sh, qreal sv) { return &( theWrappedObject->shear(sh, sv)); } bool PythonQtWrapper_QTransform::static_QTransform_squareToQuad(const QPolygonF& square, QTransform& result) { return (QTransform::squareToQuad(square, result)); } const QMatrix* PythonQtWrapper_QTransform::toAffine(QTransform* theWrappedObject) const { return &( theWrappedObject->toAffine()); } QTransform* PythonQtWrapper_QTransform::translate(QTransform* theWrappedObject, qreal dx, qreal dy) { return &( theWrappedObject->translate(dx, dy)); } QTransform PythonQtWrapper_QTransform::transposed(QTransform* theWrappedObject) const { return ( theWrappedObject->transposed()); } QTransform::TransformationType PythonQtWrapper_QTransform::type(QTransform* theWrappedObject) const { return ( theWrappedObject->type()); } QString PythonQtWrapper_QTransform::py_toString(QTransform* obj) { QString result; QDebug d(&result); d << *obj; return result; } void PythonQtShell_QTreeView::actionEvent(QActionEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "actionEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QActionEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::actionEvent(arg__1); } void PythonQtShell_QTreeView::changeEvent(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "changeEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::changeEvent(arg__1); } void PythonQtShell_QTreeView::childEvent(QChildEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "childEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QChildEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::childEvent(arg__1); } void PythonQtShell_QTreeView::closeEditor(QWidget* editor, QAbstractItemDelegate::EndEditHint hint) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "closeEditor"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QWidget*" , "QAbstractItemDelegate::EndEditHint"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); void* args[3] = {NULL, (void*)&editor, (void*)&hint}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::closeEditor(editor, hint); } void PythonQtShell_QTreeView::closeEvent(QCloseEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "closeEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QCloseEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::closeEvent(arg__1); } void PythonQtShell_QTreeView::commitData(QWidget* editor) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "commitData"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QWidget*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&editor}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::commitData(editor); } void PythonQtShell_QTreeView::contextMenuEvent(QContextMenuEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "contextMenuEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QContextMenuEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::contextMenuEvent(arg__1); } void PythonQtShell_QTreeView::currentChanged(const QModelIndex& current, const QModelIndex& previous) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "currentChanged"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "const QModelIndex&" , "const QModelIndex&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); void* args[3] = {NULL, (void*)&current, (void*)&previous}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::currentChanged(current, previous); } void PythonQtShell_QTreeView::customEvent(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "customEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::customEvent(arg__1); } void PythonQtShell_QTreeView::dataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dataChanged"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "const QModelIndex&" , "const QModelIndex&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); void* args[3] = {NULL, (void*)&topLeft, (void*)&bottomRight}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::dataChanged(topLeft, bottomRight); } int PythonQtShell_QTreeView::devType() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "devType"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); int returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("devType", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeView::devType(); } void PythonQtShell_QTreeView::doItemsLayout() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "doItemsLayout"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={""}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::doItemsLayout(); } void PythonQtShell_QTreeView::dragEnterEvent(QDragEnterEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dragEnterEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QDragEnterEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::dragEnterEvent(event); } void PythonQtShell_QTreeView::dragLeaveEvent(QDragLeaveEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dragLeaveEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QDragLeaveEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::dragLeaveEvent(event); } void PythonQtShell_QTreeView::dragMoveEvent(QDragMoveEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dragMoveEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QDragMoveEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::dragMoveEvent(event); } void PythonQtShell_QTreeView::drawBranches(QPainter* painter, const QRect& rect, const QModelIndex& index) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "drawBranches"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QPainter*" , "const QRect&" , "const QModelIndex&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(4, argumentList); void* args[4] = {NULL, (void*)&painter, (void*)&rect, (void*)&index}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::drawBranches(painter, rect, index); } void PythonQtShell_QTreeView::drawRow(QPainter* painter, const QStyleOptionViewItem& options, const QModelIndex& index) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "drawRow"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QPainter*" , "const QStyleOptionViewItem&" , "const QModelIndex&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(4, argumentList); void* args[4] = {NULL, (void*)&painter, (void*)&options, (void*)&index}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::drawRow(painter, options, index); } void PythonQtShell_QTreeView::dropEvent(QDropEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dropEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QDropEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::dropEvent(event); } bool PythonQtShell_QTreeView::edit(const QModelIndex& index, QAbstractItemView::EditTrigger trigger, QEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "edit"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "const QModelIndex&" , "QAbstractItemView::EditTrigger" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(4, argumentList); bool returnValue; void* args[4] = {NULL, (void*)&index, (void*)&trigger, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("edit", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeView::edit(index, trigger, event); } void PythonQtShell_QTreeView::editorDestroyed(QObject* editor) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "editorDestroyed"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QObject*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&editor}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::editorDestroyed(editor); } void PythonQtShell_QTreeView::enterEvent(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "enterEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::enterEvent(arg__1); } bool PythonQtShell_QTreeView::event(QEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "event"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); bool returnValue; void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("event", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeView::event(event); } bool PythonQtShell_QTreeView::eventFilter(QObject* arg__1, QEvent* arg__2) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "eventFilter"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "QObject*" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); bool returnValue; void* args[3] = {NULL, (void*)&arg__1, (void*)&arg__2}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("eventFilter", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeView::eventFilter(arg__1, arg__2); } void PythonQtShell_QTreeView::focusInEvent(QFocusEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "focusInEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QFocusEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::focusInEvent(event); } bool PythonQtShell_QTreeView::focusNextPrevChild(bool next) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "focusNextPrevChild"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "bool"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); bool returnValue; void* args[2] = {NULL, (void*)&next}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("focusNextPrevChild", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeView::focusNextPrevChild(next); } void PythonQtShell_QTreeView::focusOutEvent(QFocusEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "focusOutEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QFocusEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::focusOutEvent(event); } int PythonQtShell_QTreeView::heightForWidth(int arg__1) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "heightForWidth"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); int returnValue; void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("heightForWidth", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeView::heightForWidth(arg__1); } void PythonQtShell_QTreeView::hideEvent(QHideEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "hideEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QHideEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::hideEvent(arg__1); } int PythonQtShell_QTreeView::horizontalOffset() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "horizontalOffset"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); int returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("horizontalOffset", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeView::horizontalOffset(); } void PythonQtShell_QTreeView::horizontalScrollbarAction(int action) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "horizontalScrollbarAction"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&action}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::horizontalScrollbarAction(action); } void PythonQtShell_QTreeView::horizontalScrollbarValueChanged(int value) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "horizontalScrollbarValueChanged"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&value}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::horizontalScrollbarValueChanged(value); } QModelIndex PythonQtShell_QTreeView::indexAt(const QPoint& p) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "indexAt"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QModelIndex" , "const QPoint&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); QModelIndex returnValue; void* args[2] = {NULL, (void*)&p}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("indexAt", methodInfo, result); } else { returnValue = *((QModelIndex*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeView::indexAt(p); } void PythonQtShell_QTreeView::inputMethodEvent(QInputMethodEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "inputMethodEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QInputMethodEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::inputMethodEvent(event); } QVariant PythonQtShell_QTreeView::inputMethodQuery(Qt::InputMethodQuery query) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "inputMethodQuery"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QVariant" , "Qt::InputMethodQuery"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); QVariant returnValue; void* args[2] = {NULL, (void*)&query}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("inputMethodQuery", methodInfo, result); } else { returnValue = *((QVariant*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeView::inputMethodQuery(query); } bool PythonQtShell_QTreeView::isIndexHidden(const QModelIndex& index) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "isIndexHidden"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "const QModelIndex&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); bool returnValue; void* args[2] = {NULL, (void*)&index}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("isIndexHidden", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeView::isIndexHidden(index); } void PythonQtShell_QTreeView::keyPressEvent(QKeyEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "keyPressEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QKeyEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::keyPressEvent(event); } void PythonQtShell_QTreeView::keyReleaseEvent(QKeyEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "keyReleaseEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QKeyEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::keyReleaseEvent(arg__1); } void PythonQtShell_QTreeView::keyboardSearch(const QString& search) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "keyboardSearch"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "const QString&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&search}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::keyboardSearch(search); } void PythonQtShell_QTreeView::languageChange() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "languageChange"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={""}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::languageChange(); } void PythonQtShell_QTreeView::leaveEvent(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "leaveEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::leaveEvent(arg__1); } int PythonQtShell_QTreeView::metric(QPaintDevice::PaintDeviceMetric arg__1) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "metric"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int" , "QPaintDevice::PaintDeviceMetric"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); int returnValue; void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("metric", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeView::metric(arg__1); } void PythonQtShell_QTreeView::mouseDoubleClickEvent(QMouseEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mouseDoubleClickEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QMouseEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::mouseDoubleClickEvent(event); } void PythonQtShell_QTreeView::mouseMoveEvent(QMouseEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mouseMoveEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QMouseEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::mouseMoveEvent(event); } void PythonQtShell_QTreeView::mousePressEvent(QMouseEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mousePressEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QMouseEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::mousePressEvent(event); } void PythonQtShell_QTreeView::mouseReleaseEvent(QMouseEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mouseReleaseEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QMouseEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::mouseReleaseEvent(event); } void PythonQtShell_QTreeView::moveEvent(QMoveEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "moveEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QMoveEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::moveEvent(arg__1); } QPaintEngine* PythonQtShell_QTreeView::paintEngine() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "paintEngine"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QPaintEngine*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); QPaintEngine* returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("paintEngine", methodInfo, result); } else { returnValue = *((QPaintEngine**)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeView::paintEngine(); } void PythonQtShell_QTreeView::paintEvent(QPaintEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "paintEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QPaintEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::paintEvent(event); } void PythonQtShell_QTreeView::reset() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "reset"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={""}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::reset(); } void PythonQtShell_QTreeView::resizeEvent(QResizeEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "resizeEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QResizeEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::resizeEvent(event); } void PythonQtShell_QTreeView::rowsAboutToBeRemoved(const QModelIndex& parent, int start, int end) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "rowsAboutToBeRemoved"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "const QModelIndex&" , "int" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(4, argumentList); void* args[4] = {NULL, (void*)&parent, (void*)&start, (void*)&end}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::rowsAboutToBeRemoved(parent, start, end); } void PythonQtShell_QTreeView::rowsInserted(const QModelIndex& parent, int start, int end) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "rowsInserted"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "const QModelIndex&" , "int" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(4, argumentList); void* args[4] = {NULL, (void*)&parent, (void*)&start, (void*)&end}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::rowsInserted(parent, start, end); } void PythonQtShell_QTreeView::scrollContentsBy(int dx, int dy) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "scrollContentsBy"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "int" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); void* args[3] = {NULL, (void*)&dx, (void*)&dy}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::scrollContentsBy(dx, dy); } void PythonQtShell_QTreeView::scrollTo(const QModelIndex& index, QAbstractItemView::ScrollHint hint) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "scrollTo"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "const QModelIndex&" , "QAbstractItemView::ScrollHint"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); void* args[3] = {NULL, (void*)&index, (void*)&hint}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::scrollTo(index, hint); } void PythonQtShell_QTreeView::selectAll() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "selectAll"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={""}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::selectAll(); } QList<QModelIndex > PythonQtShell_QTreeView::selectedIndexes() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "selectedIndexes"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QList<QModelIndex >"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); QList<QModelIndex > returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("selectedIndexes", methodInfo, result); } else { returnValue = *((QList<QModelIndex >*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeView::selectedIndexes(); } void PythonQtShell_QTreeView::selectionChanged(const QItemSelection& selected, const QItemSelection& deselected) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "selectionChanged"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "const QItemSelection&" , "const QItemSelection&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); void* args[3] = {NULL, (void*)&selected, (void*)&deselected}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::selectionChanged(selected, deselected); } QItemSelectionModel::SelectionFlags PythonQtShell_QTreeView::selectionCommand(const QModelIndex& index, const QEvent* event) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "selectionCommand"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QItemSelectionModel::SelectionFlags" , "const QModelIndex&" , "const QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); QItemSelectionModel::SelectionFlags returnValue; void* args[3] = {NULL, (void*)&index, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("selectionCommand", methodInfo, result); } else { returnValue = *((QItemSelectionModel::SelectionFlags*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeView::selectionCommand(index, event); } void PythonQtShell_QTreeView::setModel(QAbstractItemModel* model) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "setModel"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QAbstractItemModel*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&model}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::setModel(model); } void PythonQtShell_QTreeView::setRootIndex(const QModelIndex& index) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "setRootIndex"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "const QModelIndex&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&index}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::setRootIndex(index); } void PythonQtShell_QTreeView::setSelection(const QRect& rect, QItemSelectionModel::SelectionFlags command) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "setSelection"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "const QRect&" , "QItemSelectionModel::SelectionFlags"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); void* args[3] = {NULL, (void*)&rect, (void*)&command}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::setSelection(rect, command); } void PythonQtShell_QTreeView::setSelectionModel(QItemSelectionModel* selectionModel) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "setSelectionModel"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QItemSelectionModel*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&selectionModel}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::setSelectionModel(selectionModel); } void PythonQtShell_QTreeView::showEvent(QShowEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "showEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QShowEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::showEvent(arg__1); } int PythonQtShell_QTreeView::sizeHintForColumn(int column) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "sizeHintForColumn"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); int returnValue; void* args[2] = {NULL, (void*)&column}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("sizeHintForColumn", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeView::sizeHintForColumn(column); } int PythonQtShell_QTreeView::sizeHintForRow(int row) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "sizeHintForRow"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); int returnValue; void* args[2] = {NULL, (void*)&row}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("sizeHintForRow", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeView::sizeHintForRow(row); } void PythonQtShell_QTreeView::startDrag(Qt::DropActions supportedActions) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "startDrag"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "Qt::DropActions"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&supportedActions}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::startDrag(supportedActions); } void PythonQtShell_QTreeView::tabletEvent(QTabletEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "tabletEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QTabletEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::tabletEvent(arg__1); } void PythonQtShell_QTreeView::timerEvent(QTimerEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "timerEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QTimerEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::timerEvent(event); } void PythonQtShell_QTreeView::updateEditorData() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "updateEditorData"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={""}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::updateEditorData(); } void PythonQtShell_QTreeView::updateEditorGeometries() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "updateEditorGeometries"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={""}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::updateEditorGeometries(); } void PythonQtShell_QTreeView::updateGeometries() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "updateGeometries"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={""}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::updateGeometries(); } int PythonQtShell_QTreeView::verticalOffset() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "verticalOffset"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); int returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("verticalOffset", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeView::verticalOffset(); } void PythonQtShell_QTreeView::verticalScrollbarAction(int action) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "verticalScrollbarAction"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&action}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::verticalScrollbarAction(action); } void PythonQtShell_QTreeView::verticalScrollbarValueChanged(int value) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "verticalScrollbarValueChanged"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&value}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::verticalScrollbarValueChanged(value); } QStyleOptionViewItem PythonQtShell_QTreeView::viewOptions() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "viewOptions"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QStyleOptionViewItem"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); QStyleOptionViewItem returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("viewOptions", methodInfo, result); } else { returnValue = *((QStyleOptionViewItem*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeView::viewOptions(); } bool PythonQtShell_QTreeView::viewportEvent(QEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "viewportEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); bool returnValue; void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("viewportEvent", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeView::viewportEvent(event); } QRect PythonQtShell_QTreeView::visualRect(const QModelIndex& index) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "visualRect"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QRect" , "const QModelIndex&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); QRect returnValue; void* args[2] = {NULL, (void*)&index}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("visualRect", methodInfo, result); } else { returnValue = *((QRect*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeView::visualRect(index); } QRegion PythonQtShell_QTreeView::visualRegionForSelection(const QItemSelection& selection) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "visualRegionForSelection"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QRegion" , "const QItemSelection&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); QRegion returnValue; void* args[2] = {NULL, (void*)&selection}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("visualRegionForSelection", methodInfo, result); } else { returnValue = *((QRegion*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeView::visualRegionForSelection(selection); } void PythonQtShell_QTreeView::wheelEvent(QWheelEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "wheelEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QWheelEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeView::wheelEvent(arg__1); } QTreeView* PythonQtWrapper_QTreeView::new_QTreeView(QWidget* parent) { return new PythonQtShell_QTreeView(parent); } bool PythonQtWrapper_QTreeView::allColumnsShowFocus(QTreeView* theWrappedObject) const { return ( theWrappedObject->allColumnsShowFocus()); } int PythonQtWrapper_QTreeView::autoExpandDelay(QTreeView* theWrappedObject) const { return ( theWrappedObject->autoExpandDelay()); } int PythonQtWrapper_QTreeView::columnAt(QTreeView* theWrappedObject, int x) const { return ( theWrappedObject->columnAt(x)); } int PythonQtWrapper_QTreeView::columnViewportPosition(QTreeView* theWrappedObject, int column) const { return ( theWrappedObject->columnViewportPosition(column)); } int PythonQtWrapper_QTreeView::columnWidth(QTreeView* theWrappedObject, int column) const { return ( theWrappedObject->columnWidth(column)); } void PythonQtWrapper_QTreeView::currentChanged(QTreeView* theWrappedObject, const QModelIndex& current, const QModelIndex& previous) { ( ((PythonQtPublicPromoter_QTreeView*)theWrappedObject)->promoted_currentChanged(current, previous)); } void PythonQtWrapper_QTreeView::dataChanged(QTreeView* theWrappedObject, const QModelIndex& topLeft, const QModelIndex& bottomRight) { ( ((PythonQtPublicPromoter_QTreeView*)theWrappedObject)->promoted_dataChanged(topLeft, bottomRight)); } void PythonQtWrapper_QTreeView::doItemsLayout(QTreeView* theWrappedObject) { ( ((PythonQtPublicPromoter_QTreeView*)theWrappedObject)->promoted_doItemsLayout()); } void PythonQtWrapper_QTreeView::dragMoveEvent(QTreeView* theWrappedObject, QDragMoveEvent* event) { ( ((PythonQtPublicPromoter_QTreeView*)theWrappedObject)->promoted_dragMoveEvent(event)); } void PythonQtWrapper_QTreeView::drawBranches(QTreeView* theWrappedObject, QPainter* painter, const QRect& rect, const QModelIndex& index) const { ( ((PythonQtPublicPromoter_QTreeView*)theWrappedObject)->promoted_drawBranches(painter, rect, index)); } void PythonQtWrapper_QTreeView::drawRow(QTreeView* theWrappedObject, QPainter* painter, const QStyleOptionViewItem& options, const QModelIndex& index) const { ( ((PythonQtPublicPromoter_QTreeView*)theWrappedObject)->promoted_drawRow(painter, options, index)); } bool PythonQtWrapper_QTreeView::expandsOnDoubleClick(QTreeView* theWrappedObject) const { return ( theWrappedObject->expandsOnDoubleClick()); } QHeaderView* PythonQtWrapper_QTreeView::header(QTreeView* theWrappedObject) const { return ( theWrappedObject->header()); } int PythonQtWrapper_QTreeView::horizontalOffset(QTreeView* theWrappedObject) const { return ( ((PythonQtPublicPromoter_QTreeView*)theWrappedObject)->promoted_horizontalOffset()); } void PythonQtWrapper_QTreeView::horizontalScrollbarAction(QTreeView* theWrappedObject, int action) { ( ((PythonQtPublicPromoter_QTreeView*)theWrappedObject)->promoted_horizontalScrollbarAction(action)); } int PythonQtWrapper_QTreeView::indentation(QTreeView* theWrappedObject) const { return ( theWrappedObject->indentation()); } QModelIndex PythonQtWrapper_QTreeView::indexAbove(QTreeView* theWrappedObject, const QModelIndex& index) const { return ( theWrappedObject->indexAbove(index)); } QModelIndex PythonQtWrapper_QTreeView::indexAt(QTreeView* theWrappedObject, const QPoint& p) const { return ( ((PythonQtPublicPromoter_QTreeView*)theWrappedObject)->promoted_indexAt(p)); } QModelIndex PythonQtWrapper_QTreeView::indexBelow(QTreeView* theWrappedObject, const QModelIndex& index) const { return ( theWrappedObject->indexBelow(index)); } bool PythonQtWrapper_QTreeView::isAnimated(QTreeView* theWrappedObject) const { return ( theWrappedObject->isAnimated()); } bool PythonQtWrapper_QTreeView::isColumnHidden(QTreeView* theWrappedObject, int column) const { return ( theWrappedObject->isColumnHidden(column)); } bool PythonQtWrapper_QTreeView::isExpanded(QTreeView* theWrappedObject, const QModelIndex& index) const { return ( theWrappedObject->isExpanded(index)); } bool PythonQtWrapper_QTreeView::isFirstColumnSpanned(QTreeView* theWrappedObject, int row, const QModelIndex& parent) const { return ( theWrappedObject->isFirstColumnSpanned(row, parent)); } bool PythonQtWrapper_QTreeView::isHeaderHidden(QTreeView* theWrappedObject) const { return ( theWrappedObject->isHeaderHidden()); } bool PythonQtWrapper_QTreeView::isIndexHidden(QTreeView* theWrappedObject, const QModelIndex& index) const { return ( ((PythonQtPublicPromoter_QTreeView*)theWrappedObject)->promoted_isIndexHidden(index)); } bool PythonQtWrapper_QTreeView::isRowHidden(QTreeView* theWrappedObject, int row, const QModelIndex& parent) const { return ( theWrappedObject->isRowHidden(row, parent)); } bool PythonQtWrapper_QTreeView::isSortingEnabled(QTreeView* theWrappedObject) const { return ( theWrappedObject->isSortingEnabled()); } bool PythonQtWrapper_QTreeView::itemsExpandable(QTreeView* theWrappedObject) const { return ( theWrappedObject->itemsExpandable()); } void PythonQtWrapper_QTreeView::keyPressEvent(QTreeView* theWrappedObject, QKeyEvent* event) { ( ((PythonQtPublicPromoter_QTreeView*)theWrappedObject)->promoted_keyPressEvent(event)); } void PythonQtWrapper_QTreeView::keyboardSearch(QTreeView* theWrappedObject, const QString& search) { ( ((PythonQtPublicPromoter_QTreeView*)theWrappedObject)->promoted_keyboardSearch(search)); } void PythonQtWrapper_QTreeView::mouseDoubleClickEvent(QTreeView* theWrappedObject, QMouseEvent* event) { ( ((PythonQtPublicPromoter_QTreeView*)theWrappedObject)->promoted_mouseDoubleClickEvent(event)); } void PythonQtWrapper_QTreeView::mouseMoveEvent(QTreeView* theWrappedObject, QMouseEvent* event) { ( ((PythonQtPublicPromoter_QTreeView*)theWrappedObject)->promoted_mouseMoveEvent(event)); } void PythonQtWrapper_QTreeView::mousePressEvent(QTreeView* theWrappedObject, QMouseEvent* event) { ( ((PythonQtPublicPromoter_QTreeView*)theWrappedObject)->promoted_mousePressEvent(event)); } void PythonQtWrapper_QTreeView::mouseReleaseEvent(QTreeView* theWrappedObject, QMouseEvent* event) { ( ((PythonQtPublicPromoter_QTreeView*)theWrappedObject)->promoted_mouseReleaseEvent(event)); } void PythonQtWrapper_QTreeView::paintEvent(QTreeView* theWrappedObject, QPaintEvent* event) { ( ((PythonQtPublicPromoter_QTreeView*)theWrappedObject)->promoted_paintEvent(event)); } void PythonQtWrapper_QTreeView::reset(QTreeView* theWrappedObject) { ( ((PythonQtPublicPromoter_QTreeView*)theWrappedObject)->promoted_reset()); } bool PythonQtWrapper_QTreeView::rootIsDecorated(QTreeView* theWrappedObject) const { return ( theWrappedObject->rootIsDecorated()); } void PythonQtWrapper_QTreeView::rowsAboutToBeRemoved(QTreeView* theWrappedObject, const QModelIndex& parent, int start, int end) { ( ((PythonQtPublicPromoter_QTreeView*)theWrappedObject)->promoted_rowsAboutToBeRemoved(parent, start, end)); } void PythonQtWrapper_QTreeView::rowsInserted(QTreeView* theWrappedObject, const QModelIndex& parent, int start, int end) { ( ((PythonQtPublicPromoter_QTreeView*)theWrappedObject)->promoted_rowsInserted(parent, start, end)); } void PythonQtWrapper_QTreeView::scrollContentsBy(QTreeView* theWrappedObject, int dx, int dy) { ( ((PythonQtPublicPromoter_QTreeView*)theWrappedObject)->promoted_scrollContentsBy(dx, dy)); } void PythonQtWrapper_QTreeView::scrollTo(QTreeView* theWrappedObject, const QModelIndex& index, QAbstractItemView::ScrollHint hint) { ( ((PythonQtPublicPromoter_QTreeView*)theWrappedObject)->promoted_scrollTo(index, hint)); } void PythonQtWrapper_QTreeView::selectAll(QTreeView* theWrappedObject) { ( ((PythonQtPublicPromoter_QTreeView*)theWrappedObject)->promoted_selectAll()); } QList<QModelIndex > PythonQtWrapper_QTreeView::selectedIndexes(QTreeView* theWrappedObject) const { return ( ((PythonQtPublicPromoter_QTreeView*)theWrappedObject)->promoted_selectedIndexes()); } void PythonQtWrapper_QTreeView::selectionChanged(QTreeView* theWrappedObject, const QItemSelection& selected, const QItemSelection& deselected) { ( ((PythonQtPublicPromoter_QTreeView*)theWrappedObject)->promoted_selectionChanged(selected, deselected)); } void PythonQtWrapper_QTreeView::setAllColumnsShowFocus(QTreeView* theWrappedObject, bool enable) { ( theWrappedObject->setAllColumnsShowFocus(enable)); } void PythonQtWrapper_QTreeView::setAnimated(QTreeView* theWrappedObject, bool enable) { ( theWrappedObject->setAnimated(enable)); } void PythonQtWrapper_QTreeView::setAutoExpandDelay(QTreeView* theWrappedObject, int delay) { ( theWrappedObject->setAutoExpandDelay(delay)); } void PythonQtWrapper_QTreeView::setColumnHidden(QTreeView* theWrappedObject, int column, bool hide) { ( theWrappedObject->setColumnHidden(column, hide)); } void PythonQtWrapper_QTreeView::setColumnWidth(QTreeView* theWrappedObject, int column, int width) { ( theWrappedObject->setColumnWidth(column, width)); } void PythonQtWrapper_QTreeView::setExpanded(QTreeView* theWrappedObject, const QModelIndex& index, bool expand) { ( theWrappedObject->setExpanded(index, expand)); } void PythonQtWrapper_QTreeView::setExpandsOnDoubleClick(QTreeView* theWrappedObject, bool enable) { ( theWrappedObject->setExpandsOnDoubleClick(enable)); } void PythonQtWrapper_QTreeView::setFirstColumnSpanned(QTreeView* theWrappedObject, int row, const QModelIndex& parent, bool span) { ( theWrappedObject->setFirstColumnSpanned(row, parent, span)); } void PythonQtWrapper_QTreeView::setHeader(QTreeView* theWrappedObject, QHeaderView* header) { ( theWrappedObject->setHeader(header)); } void PythonQtWrapper_QTreeView::setHeaderHidden(QTreeView* theWrappedObject, bool hide) { ( theWrappedObject->setHeaderHidden(hide)); } void PythonQtWrapper_QTreeView::setIndentation(QTreeView* theWrappedObject, int i) { ( theWrappedObject->setIndentation(i)); } void PythonQtWrapper_QTreeView::setItemsExpandable(QTreeView* theWrappedObject, bool enable) { ( theWrappedObject->setItemsExpandable(enable)); } void PythonQtWrapper_QTreeView::setModel(QTreeView* theWrappedObject, QAbstractItemModel* model) { ( ((PythonQtPublicPromoter_QTreeView*)theWrappedObject)->promoted_setModel(model)); } void PythonQtWrapper_QTreeView::setRootIndex(QTreeView* theWrappedObject, const QModelIndex& index) { ( ((PythonQtPublicPromoter_QTreeView*)theWrappedObject)->promoted_setRootIndex(index)); } void PythonQtWrapper_QTreeView::setRootIsDecorated(QTreeView* theWrappedObject, bool show) { ( theWrappedObject->setRootIsDecorated(show)); } void PythonQtWrapper_QTreeView::setRowHidden(QTreeView* theWrappedObject, int row, const QModelIndex& parent, bool hide) { ( theWrappedObject->setRowHidden(row, parent, hide)); } void PythonQtWrapper_QTreeView::setSelection(QTreeView* theWrappedObject, const QRect& rect, QItemSelectionModel::SelectionFlags command) { ( ((PythonQtPublicPromoter_QTreeView*)theWrappedObject)->promoted_setSelection(rect, command)); } void PythonQtWrapper_QTreeView::setSelectionModel(QTreeView* theWrappedObject, QItemSelectionModel* selectionModel) { ( ((PythonQtPublicPromoter_QTreeView*)theWrappedObject)->promoted_setSelectionModel(selectionModel)); } void PythonQtWrapper_QTreeView::setSortingEnabled(QTreeView* theWrappedObject, bool enable) { ( theWrappedObject->setSortingEnabled(enable)); } void PythonQtWrapper_QTreeView::setUniformRowHeights(QTreeView* theWrappedObject, bool uniform) { ( theWrappedObject->setUniformRowHeights(uniform)); } void PythonQtWrapper_QTreeView::setWordWrap(QTreeView* theWrappedObject, bool on) { ( theWrappedObject->setWordWrap(on)); } int PythonQtWrapper_QTreeView::sizeHintForColumn(QTreeView* theWrappedObject, int column) const { return ( ((PythonQtPublicPromoter_QTreeView*)theWrappedObject)->promoted_sizeHintForColumn(column)); } void PythonQtWrapper_QTreeView::sortByColumn(QTreeView* theWrappedObject, int column, Qt::SortOrder order) { ( theWrappedObject->sortByColumn(column, order)); } void PythonQtWrapper_QTreeView::timerEvent(QTreeView* theWrappedObject, QTimerEvent* event) { ( ((PythonQtPublicPromoter_QTreeView*)theWrappedObject)->promoted_timerEvent(event)); } bool PythonQtWrapper_QTreeView::uniformRowHeights(QTreeView* theWrappedObject) const { return ( theWrappedObject->uniformRowHeights()); } void PythonQtWrapper_QTreeView::updateGeometries(QTreeView* theWrappedObject) { ( ((PythonQtPublicPromoter_QTreeView*)theWrappedObject)->promoted_updateGeometries()); } int PythonQtWrapper_QTreeView::verticalOffset(QTreeView* theWrappedObject) const { return ( ((PythonQtPublicPromoter_QTreeView*)theWrappedObject)->promoted_verticalOffset()); } bool PythonQtWrapper_QTreeView::viewportEvent(QTreeView* theWrappedObject, QEvent* event) { return ( ((PythonQtPublicPromoter_QTreeView*)theWrappedObject)->promoted_viewportEvent(event)); } QRect PythonQtWrapper_QTreeView::visualRect(QTreeView* theWrappedObject, const QModelIndex& index) const { return ( ((PythonQtPublicPromoter_QTreeView*)theWrappedObject)->promoted_visualRect(index)); } QRegion PythonQtWrapper_QTreeView::visualRegionForSelection(QTreeView* theWrappedObject, const QItemSelection& selection) const { return ( ((PythonQtPublicPromoter_QTreeView*)theWrappedObject)->promoted_visualRegionForSelection(selection)); } bool PythonQtWrapper_QTreeView::wordWrap(QTreeView* theWrappedObject) const { return ( theWrappedObject->wordWrap()); } void PythonQtShell_QTreeWidget::actionEvent(QActionEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "actionEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QActionEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::actionEvent(arg__1); } void PythonQtShell_QTreeWidget::changeEvent(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "changeEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::changeEvent(arg__1); } void PythonQtShell_QTreeWidget::childEvent(QChildEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "childEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QChildEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::childEvent(arg__1); } void PythonQtShell_QTreeWidget::closeEditor(QWidget* editor, QAbstractItemDelegate::EndEditHint hint) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "closeEditor"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QWidget*" , "QAbstractItemDelegate::EndEditHint"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); void* args[3] = {NULL, (void*)&editor, (void*)&hint}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::closeEditor(editor, hint); } void PythonQtShell_QTreeWidget::closeEvent(QCloseEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "closeEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QCloseEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::closeEvent(arg__1); } void PythonQtShell_QTreeWidget::commitData(QWidget* editor) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "commitData"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QWidget*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&editor}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::commitData(editor); } void PythonQtShell_QTreeWidget::contextMenuEvent(QContextMenuEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "contextMenuEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QContextMenuEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::contextMenuEvent(arg__1); } void PythonQtShell_QTreeWidget::currentChanged(const QModelIndex& current, const QModelIndex& previous) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "currentChanged"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "const QModelIndex&" , "const QModelIndex&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); void* args[3] = {NULL, (void*)&current, (void*)&previous}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::currentChanged(current, previous); } void PythonQtShell_QTreeWidget::customEvent(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "customEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::customEvent(arg__1); } void PythonQtShell_QTreeWidget::dataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dataChanged"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "const QModelIndex&" , "const QModelIndex&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); void* args[3] = {NULL, (void*)&topLeft, (void*)&bottomRight}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::dataChanged(topLeft, bottomRight); } int PythonQtShell_QTreeWidget::devType() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "devType"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); int returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("devType", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeWidget::devType(); } void PythonQtShell_QTreeWidget::doItemsLayout() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "doItemsLayout"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={""}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::doItemsLayout(); } void PythonQtShell_QTreeWidget::dragEnterEvent(QDragEnterEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dragEnterEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QDragEnterEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::dragEnterEvent(event); } void PythonQtShell_QTreeWidget::dragLeaveEvent(QDragLeaveEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dragLeaveEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QDragLeaveEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::dragLeaveEvent(event); } void PythonQtShell_QTreeWidget::dragMoveEvent(QDragMoveEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dragMoveEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QDragMoveEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::dragMoveEvent(event); } void PythonQtShell_QTreeWidget::drawBranches(QPainter* painter, const QRect& rect, const QModelIndex& index) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "drawBranches"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QPainter*" , "const QRect&" , "const QModelIndex&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(4, argumentList); void* args[4] = {NULL, (void*)&painter, (void*)&rect, (void*)&index}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::drawBranches(painter, rect, index); } void PythonQtShell_QTreeWidget::drawRow(QPainter* painter, const QStyleOptionViewItem& options, const QModelIndex& index) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "drawRow"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QPainter*" , "const QStyleOptionViewItem&" , "const QModelIndex&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(4, argumentList); void* args[4] = {NULL, (void*)&painter, (void*)&options, (void*)&index}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::drawRow(painter, options, index); } void PythonQtShell_QTreeWidget::dropEvent(QDropEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dropEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QDropEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::dropEvent(event); } bool PythonQtShell_QTreeWidget::dropMimeData(QTreeWidgetItem* parent, int index, const QMimeData* data, Qt::DropAction action) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dropMimeData"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "QTreeWidgetItem*" , "int" , "const QMimeData*" , "Qt::DropAction"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(5, argumentList); bool returnValue; void* args[5] = {NULL, (void*)&parent, (void*)&index, (void*)&data, (void*)&action}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("dropMimeData", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeWidget::dropMimeData(parent, index, data, action); } bool PythonQtShell_QTreeWidget::edit(const QModelIndex& index, QAbstractItemView::EditTrigger trigger, QEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "edit"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "const QModelIndex&" , "QAbstractItemView::EditTrigger" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(4, argumentList); bool returnValue; void* args[4] = {NULL, (void*)&index, (void*)&trigger, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("edit", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeWidget::edit(index, trigger, event); } void PythonQtShell_QTreeWidget::editorDestroyed(QObject* editor) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "editorDestroyed"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QObject*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&editor}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::editorDestroyed(editor); } void PythonQtShell_QTreeWidget::enterEvent(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "enterEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::enterEvent(arg__1); } bool PythonQtShell_QTreeWidget::event(QEvent* e) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "event"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); bool returnValue; void* args[2] = {NULL, (void*)&e}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("event", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeWidget::event(e); } bool PythonQtShell_QTreeWidget::eventFilter(QObject* arg__1, QEvent* arg__2) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "eventFilter"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "QObject*" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); bool returnValue; void* args[3] = {NULL, (void*)&arg__1, (void*)&arg__2}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("eventFilter", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeWidget::eventFilter(arg__1, arg__2); } void PythonQtShell_QTreeWidget::focusInEvent(QFocusEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "focusInEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QFocusEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::focusInEvent(event); } bool PythonQtShell_QTreeWidget::focusNextPrevChild(bool next) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "focusNextPrevChild"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "bool"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); bool returnValue; void* args[2] = {NULL, (void*)&next}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("focusNextPrevChild", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeWidget::focusNextPrevChild(next); } void PythonQtShell_QTreeWidget::focusOutEvent(QFocusEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "focusOutEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QFocusEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::focusOutEvent(event); } int PythonQtShell_QTreeWidget::heightForWidth(int arg__1) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "heightForWidth"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); int returnValue; void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("heightForWidth", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeWidget::heightForWidth(arg__1); } void PythonQtShell_QTreeWidget::hideEvent(QHideEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "hideEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QHideEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::hideEvent(arg__1); } int PythonQtShell_QTreeWidget::horizontalOffset() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "horizontalOffset"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); int returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("horizontalOffset", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeWidget::horizontalOffset(); } void PythonQtShell_QTreeWidget::horizontalScrollbarAction(int action) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "horizontalScrollbarAction"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&action}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::horizontalScrollbarAction(action); } void PythonQtShell_QTreeWidget::horizontalScrollbarValueChanged(int value) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "horizontalScrollbarValueChanged"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&value}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::horizontalScrollbarValueChanged(value); } QModelIndex PythonQtShell_QTreeWidget::indexAt(const QPoint& p) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "indexAt"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QModelIndex" , "const QPoint&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); QModelIndex returnValue; void* args[2] = {NULL, (void*)&p}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("indexAt", methodInfo, result); } else { returnValue = *((QModelIndex*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeWidget::indexAt(p); } void PythonQtShell_QTreeWidget::inputMethodEvent(QInputMethodEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "inputMethodEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QInputMethodEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::inputMethodEvent(event); } QVariant PythonQtShell_QTreeWidget::inputMethodQuery(Qt::InputMethodQuery query) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "inputMethodQuery"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QVariant" , "Qt::InputMethodQuery"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); QVariant returnValue; void* args[2] = {NULL, (void*)&query}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("inputMethodQuery", methodInfo, result); } else { returnValue = *((QVariant*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeWidget::inputMethodQuery(query); } bool PythonQtShell_QTreeWidget::isIndexHidden(const QModelIndex& index) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "isIndexHidden"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "const QModelIndex&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); bool returnValue; void* args[2] = {NULL, (void*)&index}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("isIndexHidden", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeWidget::isIndexHidden(index); } void PythonQtShell_QTreeWidget::keyPressEvent(QKeyEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "keyPressEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QKeyEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::keyPressEvent(event); } void PythonQtShell_QTreeWidget::keyReleaseEvent(QKeyEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "keyReleaseEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QKeyEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::keyReleaseEvent(arg__1); } void PythonQtShell_QTreeWidget::keyboardSearch(const QString& search) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "keyboardSearch"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "const QString&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&search}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::keyboardSearch(search); } void PythonQtShell_QTreeWidget::languageChange() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "languageChange"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={""}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::languageChange(); } void PythonQtShell_QTreeWidget::leaveEvent(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "leaveEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::leaveEvent(arg__1); } int PythonQtShell_QTreeWidget::metric(QPaintDevice::PaintDeviceMetric arg__1) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "metric"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int" , "QPaintDevice::PaintDeviceMetric"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); int returnValue; void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("metric", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeWidget::metric(arg__1); } QMimeData* PythonQtShell_QTreeWidget::mimeData(const QList<QTreeWidgetItem* > items) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mimeData"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QMimeData*" , "const QList<QTreeWidgetItem* >"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); QMimeData* returnValue; void* args[2] = {NULL, (void*)&items}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("mimeData", methodInfo, result); } else { returnValue = *((QMimeData**)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeWidget::mimeData(items); } QStringList PythonQtShell_QTreeWidget::mimeTypes() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mimeTypes"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QStringList"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); QStringList returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("mimeTypes", methodInfo, result); } else { returnValue = *((QStringList*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeWidget::mimeTypes(); } void PythonQtShell_QTreeWidget::mouseDoubleClickEvent(QMouseEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mouseDoubleClickEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QMouseEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::mouseDoubleClickEvent(event); } void PythonQtShell_QTreeWidget::mouseMoveEvent(QMouseEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mouseMoveEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QMouseEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::mouseMoveEvent(event); } void PythonQtShell_QTreeWidget::mousePressEvent(QMouseEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mousePressEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QMouseEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::mousePressEvent(event); } void PythonQtShell_QTreeWidget::mouseReleaseEvent(QMouseEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mouseReleaseEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QMouseEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::mouseReleaseEvent(event); } void PythonQtShell_QTreeWidget::moveEvent(QMoveEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "moveEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QMoveEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::moveEvent(arg__1); } QPaintEngine* PythonQtShell_QTreeWidget::paintEngine() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "paintEngine"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QPaintEngine*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); QPaintEngine* returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("paintEngine", methodInfo, result); } else { returnValue = *((QPaintEngine**)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeWidget::paintEngine(); } void PythonQtShell_QTreeWidget::paintEvent(QPaintEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "paintEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QPaintEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::paintEvent(event); } void PythonQtShell_QTreeWidget::reset() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "reset"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={""}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::reset(); } void PythonQtShell_QTreeWidget::resizeEvent(QResizeEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "resizeEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QResizeEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::resizeEvent(event); } void PythonQtShell_QTreeWidget::rowsAboutToBeRemoved(const QModelIndex& parent, int start, int end) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "rowsAboutToBeRemoved"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "const QModelIndex&" , "int" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(4, argumentList); void* args[4] = {NULL, (void*)&parent, (void*)&start, (void*)&end}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::rowsAboutToBeRemoved(parent, start, end); } void PythonQtShell_QTreeWidget::rowsInserted(const QModelIndex& parent, int start, int end) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "rowsInserted"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "const QModelIndex&" , "int" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(4, argumentList); void* args[4] = {NULL, (void*)&parent, (void*)&start, (void*)&end}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::rowsInserted(parent, start, end); } void PythonQtShell_QTreeWidget::scrollContentsBy(int dx, int dy) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "scrollContentsBy"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "int" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); void* args[3] = {NULL, (void*)&dx, (void*)&dy}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::scrollContentsBy(dx, dy); } void PythonQtShell_QTreeWidget::scrollTo(const QModelIndex& index, QAbstractItemView::ScrollHint hint) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "scrollTo"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "const QModelIndex&" , "QAbstractItemView::ScrollHint"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); void* args[3] = {NULL, (void*)&index, (void*)&hint}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::scrollTo(index, hint); } void PythonQtShell_QTreeWidget::selectAll() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "selectAll"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={""}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::selectAll(); } QList<QModelIndex > PythonQtShell_QTreeWidget::selectedIndexes() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "selectedIndexes"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QList<QModelIndex >"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); QList<QModelIndex > returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("selectedIndexes", methodInfo, result); } else { returnValue = *((QList<QModelIndex >*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeWidget::selectedIndexes(); } void PythonQtShell_QTreeWidget::selectionChanged(const QItemSelection& selected, const QItemSelection& deselected) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "selectionChanged"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "const QItemSelection&" , "const QItemSelection&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); void* args[3] = {NULL, (void*)&selected, (void*)&deselected}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::selectionChanged(selected, deselected); } QItemSelectionModel::SelectionFlags PythonQtShell_QTreeWidget::selectionCommand(const QModelIndex& index, const QEvent* event) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "selectionCommand"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QItemSelectionModel::SelectionFlags" , "const QModelIndex&" , "const QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); QItemSelectionModel::SelectionFlags returnValue; void* args[3] = {NULL, (void*)&index, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("selectionCommand", methodInfo, result); } else { returnValue = *((QItemSelectionModel::SelectionFlags*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeWidget::selectionCommand(index, event); } void PythonQtShell_QTreeWidget::setRootIndex(const QModelIndex& index) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "setRootIndex"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "const QModelIndex&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&index}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::setRootIndex(index); } void PythonQtShell_QTreeWidget::setSelection(const QRect& rect, QItemSelectionModel::SelectionFlags command) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "setSelection"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "const QRect&" , "QItemSelectionModel::SelectionFlags"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); void* args[3] = {NULL, (void*)&rect, (void*)&command}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::setSelection(rect, command); } void PythonQtShell_QTreeWidget::setSelectionModel(QItemSelectionModel* selectionModel) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "setSelectionModel"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QItemSelectionModel*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&selectionModel}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::setSelectionModel(selectionModel); } void PythonQtShell_QTreeWidget::showEvent(QShowEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "showEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QShowEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::showEvent(arg__1); } int PythonQtShell_QTreeWidget::sizeHintForColumn(int column) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "sizeHintForColumn"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); int returnValue; void* args[2] = {NULL, (void*)&column}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("sizeHintForColumn", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeWidget::sizeHintForColumn(column); } int PythonQtShell_QTreeWidget::sizeHintForRow(int row) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "sizeHintForRow"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); int returnValue; void* args[2] = {NULL, (void*)&row}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("sizeHintForRow", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeWidget::sizeHintForRow(row); } void PythonQtShell_QTreeWidget::startDrag(Qt::DropActions supportedActions) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "startDrag"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "Qt::DropActions"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&supportedActions}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::startDrag(supportedActions); } Qt::DropActions PythonQtShell_QTreeWidget::supportedDropActions() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "supportedDropActions"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"Qt::DropActions"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); Qt::DropActions returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("supportedDropActions", methodInfo, result); } else { returnValue = *((Qt::DropActions*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeWidget::supportedDropActions(); } void PythonQtShell_QTreeWidget::tabletEvent(QTabletEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "tabletEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QTabletEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::tabletEvent(arg__1); } void PythonQtShell_QTreeWidget::timerEvent(QTimerEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "timerEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QTimerEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::timerEvent(event); } void PythonQtShell_QTreeWidget::updateEditorData() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "updateEditorData"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={""}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::updateEditorData(); } void PythonQtShell_QTreeWidget::updateEditorGeometries() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "updateEditorGeometries"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={""}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::updateEditorGeometries(); } void PythonQtShell_QTreeWidget::updateGeometries() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "updateGeometries"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={""}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::updateGeometries(); } int PythonQtShell_QTreeWidget::verticalOffset() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "verticalOffset"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); int returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("verticalOffset", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeWidget::verticalOffset(); } void PythonQtShell_QTreeWidget::verticalScrollbarAction(int action) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "verticalScrollbarAction"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&action}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::verticalScrollbarAction(action); } void PythonQtShell_QTreeWidget::verticalScrollbarValueChanged(int value) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "verticalScrollbarValueChanged"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&value}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::verticalScrollbarValueChanged(value); } QStyleOptionViewItem PythonQtShell_QTreeWidget::viewOptions() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "viewOptions"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QStyleOptionViewItem"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); QStyleOptionViewItem returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("viewOptions", methodInfo, result); } else { returnValue = *((QStyleOptionViewItem*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeWidget::viewOptions(); } bool PythonQtShell_QTreeWidget::viewportEvent(QEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "viewportEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); bool returnValue; void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("viewportEvent", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeWidget::viewportEvent(event); } QRect PythonQtShell_QTreeWidget::visualRect(const QModelIndex& index) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "visualRect"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QRect" , "const QModelIndex&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); QRect returnValue; void* args[2] = {NULL, (void*)&index}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("visualRect", methodInfo, result); } else { returnValue = *((QRect*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeWidget::visualRect(index); } QRegion PythonQtShell_QTreeWidget::visualRegionForSelection(const QItemSelection& selection) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "visualRegionForSelection"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QRegion" , "const QItemSelection&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); QRegion returnValue; void* args[2] = {NULL, (void*)&selection}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("visualRegionForSelection", methodInfo, result); } else { returnValue = *((QRegion*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeWidget::visualRegionForSelection(selection); } void PythonQtShell_QTreeWidget::wheelEvent(QWheelEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "wheelEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QWheelEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidget::wheelEvent(arg__1); } QTreeWidget* PythonQtWrapper_QTreeWidget::new_QTreeWidget(QWidget* parent) { return new PythonQtShell_QTreeWidget(parent); } void PythonQtWrapper_QTreeWidget::addTopLevelItem(QTreeWidget* theWrappedObject, QTreeWidgetItem* item) { ( theWrappedObject->addTopLevelItem(item)); } void PythonQtWrapper_QTreeWidget::addTopLevelItems(QTreeWidget* theWrappedObject, const QList<QTreeWidgetItem* >& items) { ( theWrappedObject->addTopLevelItems(items)); } void PythonQtWrapper_QTreeWidget::closePersistentEditor(QTreeWidget* theWrappedObject, QTreeWidgetItem* item, int column) { ( theWrappedObject->closePersistentEditor(item, column)); } int PythonQtWrapper_QTreeWidget::columnCount(QTreeWidget* theWrappedObject) const { return ( theWrappedObject->columnCount()); } int PythonQtWrapper_QTreeWidget::currentColumn(QTreeWidget* theWrappedObject) const { return ( theWrappedObject->currentColumn()); } QTreeWidgetItem* PythonQtWrapper_QTreeWidget::currentItem(QTreeWidget* theWrappedObject) const { return ( theWrappedObject->currentItem()); } void PythonQtWrapper_QTreeWidget::dropEvent(QTreeWidget* theWrappedObject, QDropEvent* event) { ( ((PythonQtPublicPromoter_QTreeWidget*)theWrappedObject)->promoted_dropEvent(event)); } bool PythonQtWrapper_QTreeWidget::dropMimeData(QTreeWidget* theWrappedObject, QTreeWidgetItem* parent, int index, const QMimeData* data, Qt::DropAction action) { return ( ((PythonQtPublicPromoter_QTreeWidget*)theWrappedObject)->promoted_dropMimeData(parent, index, data, action)); } void PythonQtWrapper_QTreeWidget::editItem(QTreeWidget* theWrappedObject, QTreeWidgetItem* item, int column) { ( theWrappedObject->editItem(item, column)); } bool PythonQtWrapper_QTreeWidget::event(QTreeWidget* theWrappedObject, QEvent* e) { return ( ((PythonQtPublicPromoter_QTreeWidget*)theWrappedObject)->promoted_event(e)); } QList<QTreeWidgetItem* > PythonQtWrapper_QTreeWidget::findItems(QTreeWidget* theWrappedObject, const QString& text, Qt::MatchFlags flags, int column) const { return ( theWrappedObject->findItems(text, flags, column)); } QTreeWidgetItem* PythonQtWrapper_QTreeWidget::headerItem(QTreeWidget* theWrappedObject) const { return ( theWrappedObject->headerItem()); } int PythonQtWrapper_QTreeWidget::indexOfTopLevelItem(QTreeWidget* theWrappedObject, QTreeWidgetItem* item) const { return ( theWrappedObject->indexOfTopLevelItem(item)); } void PythonQtWrapper_QTreeWidget::insertTopLevelItem(QTreeWidget* theWrappedObject, int index, QTreeWidgetItem* item) { ( theWrappedObject->insertTopLevelItem(index, item)); } void PythonQtWrapper_QTreeWidget::insertTopLevelItems(QTreeWidget* theWrappedObject, int index, const QList<QTreeWidgetItem* >& items) { ( theWrappedObject->insertTopLevelItems(index, items)); } QTreeWidgetItem* PythonQtWrapper_QTreeWidget::invisibleRootItem(QTreeWidget* theWrappedObject) const { return ( theWrappedObject->invisibleRootItem()); } bool PythonQtWrapper_QTreeWidget::isFirstItemColumnSpanned(QTreeWidget* theWrappedObject, const QTreeWidgetItem* item) const { return ( theWrappedObject->isFirstItemColumnSpanned(item)); } QTreeWidgetItem* PythonQtWrapper_QTreeWidget::itemAbove(QTreeWidget* theWrappedObject, const QTreeWidgetItem* item) const { return ( theWrappedObject->itemAbove(item)); } QTreeWidgetItem* PythonQtWrapper_QTreeWidget::itemAt(QTreeWidget* theWrappedObject, const QPoint& p) const { return ( theWrappedObject->itemAt(p)); } QTreeWidgetItem* PythonQtWrapper_QTreeWidget::itemAt(QTreeWidget* theWrappedObject, int x, int y) const { return ( theWrappedObject->itemAt(x, y)); } QTreeWidgetItem* PythonQtWrapper_QTreeWidget::itemBelow(QTreeWidget* theWrappedObject, const QTreeWidgetItem* item) const { return ( theWrappedObject->itemBelow(item)); } QWidget* PythonQtWrapper_QTreeWidget::itemWidget(QTreeWidget* theWrappedObject, QTreeWidgetItem* item, int column) const { return ( theWrappedObject->itemWidget(item, column)); } QStringList PythonQtWrapper_QTreeWidget::mimeTypes(QTreeWidget* theWrappedObject) const { return ( ((PythonQtPublicPromoter_QTreeWidget*)theWrappedObject)->promoted_mimeTypes()); } void PythonQtWrapper_QTreeWidget::openPersistentEditor(QTreeWidget* theWrappedObject, QTreeWidgetItem* item, int column) { ( theWrappedObject->openPersistentEditor(item, column)); } void PythonQtWrapper_QTreeWidget::removeItemWidget(QTreeWidget* theWrappedObject, QTreeWidgetItem* item, int column) { ( theWrappedObject->removeItemWidget(item, column)); } QList<QTreeWidgetItem* > PythonQtWrapper_QTreeWidget::selectedItems(QTreeWidget* theWrappedObject) const { return ( theWrappedObject->selectedItems()); } void PythonQtWrapper_QTreeWidget::setColumnCount(QTreeWidget* theWrappedObject, int columns) { ( theWrappedObject->setColumnCount(columns)); } void PythonQtWrapper_QTreeWidget::setCurrentItem(QTreeWidget* theWrappedObject, QTreeWidgetItem* item) { ( theWrappedObject->setCurrentItem(item)); } void PythonQtWrapper_QTreeWidget::setCurrentItem(QTreeWidget* theWrappedObject, QTreeWidgetItem* item, int column) { ( theWrappedObject->setCurrentItem(item, column)); } void PythonQtWrapper_QTreeWidget::setCurrentItem(QTreeWidget* theWrappedObject, QTreeWidgetItem* item, int column, QItemSelectionModel::SelectionFlags command) { ( theWrappedObject->setCurrentItem(item, column, command)); } void PythonQtWrapper_QTreeWidget::setFirstItemColumnSpanned(QTreeWidget* theWrappedObject, const QTreeWidgetItem* item, bool span) { ( theWrappedObject->setFirstItemColumnSpanned(item, span)); } void PythonQtWrapper_QTreeWidget::setHeaderItem(QTreeWidget* theWrappedObject, QTreeWidgetItem* item) { ( theWrappedObject->setHeaderItem(item)); } void PythonQtWrapper_QTreeWidget::setHeaderLabel(QTreeWidget* theWrappedObject, const QString& label) { ( theWrappedObject->setHeaderLabel(label)); } void PythonQtWrapper_QTreeWidget::setHeaderLabels(QTreeWidget* theWrappedObject, const QStringList& labels) { ( theWrappedObject->setHeaderLabels(labels)); } void PythonQtWrapper_QTreeWidget::setItemWidget(QTreeWidget* theWrappedObject, QTreeWidgetItem* item, int column, QWidget* widget) { ( theWrappedObject->setItemWidget(item, column, widget)); } void PythonQtWrapper_QTreeWidget::setSelectionModel(QTreeWidget* theWrappedObject, QItemSelectionModel* selectionModel) { ( ((PythonQtPublicPromoter_QTreeWidget*)theWrappedObject)->promoted_setSelectionModel(selectionModel)); } int PythonQtWrapper_QTreeWidget::sortColumn(QTreeWidget* theWrappedObject) const { return ( theWrappedObject->sortColumn()); } void PythonQtWrapper_QTreeWidget::sortItems(QTreeWidget* theWrappedObject, int column, Qt::SortOrder order) { ( theWrappedObject->sortItems(column, order)); } Qt::DropActions PythonQtWrapper_QTreeWidget::supportedDropActions(QTreeWidget* theWrappedObject) const { return ( ((PythonQtPublicPromoter_QTreeWidget*)theWrappedObject)->promoted_supportedDropActions()); } QTreeWidgetItem* PythonQtWrapper_QTreeWidget::takeTopLevelItem(QTreeWidget* theWrappedObject, int index) { return ( theWrappedObject->takeTopLevelItem(index)); } QTreeWidgetItem* PythonQtWrapper_QTreeWidget::topLevelItem(QTreeWidget* theWrappedObject, int index) const { return ( theWrappedObject->topLevelItem(index)); } int PythonQtWrapper_QTreeWidget::topLevelItemCount(QTreeWidget* theWrappedObject) const { return ( theWrappedObject->topLevelItemCount()); } QRect PythonQtWrapper_QTreeWidget::visualItemRect(QTreeWidget* theWrappedObject, const QTreeWidgetItem* item) const { return ( theWrappedObject->visualItemRect(item)); } QTreeWidgetItem* PythonQtShell_QTreeWidgetItem::clone() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "clone"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QTreeWidgetItem*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); QTreeWidgetItem* returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("clone", methodInfo, result); } else { returnValue = *((QTreeWidgetItem**)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeWidgetItem::clone(); } QVariant PythonQtShell_QTreeWidgetItem::data(int column, int role) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "data"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QVariant" , "int" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); QVariant returnValue; void* args[3] = {NULL, (void*)&column, (void*)&role}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("data", methodInfo, result); } else { returnValue = *((QVariant*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeWidgetItem::data(column, role); } bool PythonQtShell_QTreeWidgetItem::__lt__(const QTreeWidgetItem& other) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "__lt__"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "const QTreeWidgetItem&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); bool returnValue; void* args[2] = {NULL, (void*)&other}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("__lt__", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QTreeWidgetItem::operator<(other); } void PythonQtShell_QTreeWidgetItem::read(QDataStream& in) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "read"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QDataStream&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&in}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidgetItem::read(in); } void PythonQtShell_QTreeWidgetItem::setData(int column, int role, const QVariant& value) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "setData"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "int" , "int" , "const QVariant&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(4, argumentList); void* args[4] = {NULL, (void*)&column, (void*)&role, (void*)&value}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidgetItem::setData(column, role, value); } void PythonQtShell_QTreeWidgetItem::write(QDataStream& out) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "write"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QDataStream&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&out}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QTreeWidgetItem::write(out); } QTreeWidgetItem* PythonQtWrapper_QTreeWidgetItem::new_QTreeWidgetItem(QTreeWidget* view, QTreeWidgetItem* after, int type) { return new PythonQtShell_QTreeWidgetItem(view, after, type); } QTreeWidgetItem* PythonQtWrapper_QTreeWidgetItem::new_QTreeWidgetItem(QTreeWidget* view, const QStringList& strings, int type) { return new PythonQtShell_QTreeWidgetItem(view, strings, type); } QTreeWidgetItem* PythonQtWrapper_QTreeWidgetItem::new_QTreeWidgetItem(QTreeWidget* view, int type) { return new PythonQtShell_QTreeWidgetItem(view, type); } QTreeWidgetItem* PythonQtWrapper_QTreeWidgetItem::new_QTreeWidgetItem(QTreeWidgetItem* parent, QTreeWidgetItem* after, int type) { return new PythonQtShell_QTreeWidgetItem(parent, after, type); } QTreeWidgetItem* PythonQtWrapper_QTreeWidgetItem::new_QTreeWidgetItem(QTreeWidgetItem* parent, const QStringList& strings, int type) { return new PythonQtShell_QTreeWidgetItem(parent, strings, type); } QTreeWidgetItem* PythonQtWrapper_QTreeWidgetItem::new_QTreeWidgetItem(QTreeWidgetItem* parent, int type) { return new PythonQtShell_QTreeWidgetItem(parent, type); } QTreeWidgetItem* PythonQtWrapper_QTreeWidgetItem::new_QTreeWidgetItem(const QStringList& strings, int type) { return new PythonQtShell_QTreeWidgetItem(strings, type); } QTreeWidgetItem* PythonQtWrapper_QTreeWidgetItem::new_QTreeWidgetItem(int type) { return new PythonQtShell_QTreeWidgetItem(type); } void PythonQtWrapper_QTreeWidgetItem::addChild(QTreeWidgetItem* theWrappedObject, QTreeWidgetItem* child) { ( theWrappedObject->addChild(child)); } void PythonQtWrapper_QTreeWidgetItem::addChildren(QTreeWidgetItem* theWrappedObject, const QList<QTreeWidgetItem* >& children) { ( theWrappedObject->addChildren(children)); } QBrush PythonQtWrapper_QTreeWidgetItem::background(QTreeWidgetItem* theWrappedObject, int column) const { return ( theWrappedObject->background(column)); } Qt::CheckState PythonQtWrapper_QTreeWidgetItem::checkState(QTreeWidgetItem* theWrappedObject, int column) const { return ( theWrappedObject->checkState(column)); } QTreeWidgetItem* PythonQtWrapper_QTreeWidgetItem::child(QTreeWidgetItem* theWrappedObject, int index) const { return ( theWrappedObject->child(index)); } int PythonQtWrapper_QTreeWidgetItem::childCount(QTreeWidgetItem* theWrappedObject) const { return ( theWrappedObject->childCount()); } QTreeWidgetItem::ChildIndicatorPolicy PythonQtWrapper_QTreeWidgetItem::childIndicatorPolicy(QTreeWidgetItem* theWrappedObject) const { return ( theWrappedObject->childIndicatorPolicy()); } QTreeWidgetItem* PythonQtWrapper_QTreeWidgetItem::clone(QTreeWidgetItem* theWrappedObject) const { return ( ((PythonQtPublicPromoter_QTreeWidgetItem*)theWrappedObject)->promoted_clone()); } int PythonQtWrapper_QTreeWidgetItem::columnCount(QTreeWidgetItem* theWrappedObject) const { return ( theWrappedObject->columnCount()); } QVariant PythonQtWrapper_QTreeWidgetItem::data(QTreeWidgetItem* theWrappedObject, int column, int role) const { return ( ((PythonQtPublicPromoter_QTreeWidgetItem*)theWrappedObject)->promoted_data(column, role)); } Qt::ItemFlags PythonQtWrapper_QTreeWidgetItem::flags(QTreeWidgetItem* theWrappedObject) const { return ( theWrappedObject->flags()); } QFont PythonQtWrapper_QTreeWidgetItem::font(QTreeWidgetItem* theWrappedObject, int column) const { return ( theWrappedObject->font(column)); } QBrush PythonQtWrapper_QTreeWidgetItem::foreground(QTreeWidgetItem* theWrappedObject, int column) const { return ( theWrappedObject->foreground(column)); } QIcon PythonQtWrapper_QTreeWidgetItem::icon(QTreeWidgetItem* theWrappedObject, int column) const { return ( theWrappedObject->icon(column)); } int PythonQtWrapper_QTreeWidgetItem::indexOfChild(QTreeWidgetItem* theWrappedObject, QTreeWidgetItem* child) const { return ( theWrappedObject->indexOfChild(child)); } void PythonQtWrapper_QTreeWidgetItem::insertChild(QTreeWidgetItem* theWrappedObject, int index, QTreeWidgetItem* child) { ( theWrappedObject->insertChild(index, child)); } void PythonQtWrapper_QTreeWidgetItem::insertChildren(QTreeWidgetItem* theWrappedObject, int index, const QList<QTreeWidgetItem* >& children) { ( theWrappedObject->insertChildren(index, children)); } bool PythonQtWrapper_QTreeWidgetItem::isDisabled(QTreeWidgetItem* theWrappedObject) const { return ( theWrappedObject->isDisabled()); } bool PythonQtWrapper_QTreeWidgetItem::isExpanded(QTreeWidgetItem* theWrappedObject) const { return ( theWrappedObject->isExpanded()); } bool PythonQtWrapper_QTreeWidgetItem::isFirstColumnSpanned(QTreeWidgetItem* theWrappedObject) const { return ( theWrappedObject->isFirstColumnSpanned()); } bool PythonQtWrapper_QTreeWidgetItem::isHidden(QTreeWidgetItem* theWrappedObject) const { return ( theWrappedObject->isHidden()); } bool PythonQtWrapper_QTreeWidgetItem::isSelected(QTreeWidgetItem* theWrappedObject) const { return ( theWrappedObject->isSelected()); } void PythonQtWrapper_QTreeWidgetItem::writeTo(QTreeWidgetItem* theWrappedObject, QDataStream& out) { out << (*theWrappedObject); } void PythonQtWrapper_QTreeWidgetItem::readFrom(QTreeWidgetItem* theWrappedObject, QDataStream& in) { in >> (*theWrappedObject); } QTreeWidgetItem* PythonQtWrapper_QTreeWidgetItem::parent(QTreeWidgetItem* theWrappedObject) const { return ( theWrappedObject->parent()); } void PythonQtWrapper_QTreeWidgetItem::removeChild(QTreeWidgetItem* theWrappedObject, QTreeWidgetItem* child) { ( theWrappedObject->removeChild(child)); } void PythonQtWrapper_QTreeWidgetItem::setBackground(QTreeWidgetItem* theWrappedObject, int column, const QBrush& brush) { ( theWrappedObject->setBackground(column, brush)); } void PythonQtWrapper_QTreeWidgetItem::setCheckState(QTreeWidgetItem* theWrappedObject, int column, Qt::CheckState state) { ( theWrappedObject->setCheckState(column, state)); } void PythonQtWrapper_QTreeWidgetItem::setChildIndicatorPolicy(QTreeWidgetItem* theWrappedObject, QTreeWidgetItem::ChildIndicatorPolicy policy) { ( theWrappedObject->setChildIndicatorPolicy(policy)); } void PythonQtWrapper_QTreeWidgetItem::setData(QTreeWidgetItem* theWrappedObject, int column, int role, const QVariant& value) { ( ((PythonQtPublicPromoter_QTreeWidgetItem*)theWrappedObject)->promoted_setData(column, role, value)); } void PythonQtWrapper_QTreeWidgetItem::setDisabled(QTreeWidgetItem* theWrappedObject, bool disabled) { ( theWrappedObject->setDisabled(disabled)); } void PythonQtWrapper_QTreeWidgetItem::setExpanded(QTreeWidgetItem* theWrappedObject, bool expand) { ( theWrappedObject->setExpanded(expand)); } void PythonQtWrapper_QTreeWidgetItem::setFirstColumnSpanned(QTreeWidgetItem* theWrappedObject, bool span) { ( theWrappedObject->setFirstColumnSpanned(span)); } void PythonQtWrapper_QTreeWidgetItem::setFlags(QTreeWidgetItem* theWrappedObject, Qt::ItemFlags flags) { ( theWrappedObject->setFlags(flags)); } void PythonQtWrapper_QTreeWidgetItem::setFont(QTreeWidgetItem* theWrappedObject, int column, const QFont& font) { ( theWrappedObject->setFont(column, font)); } void PythonQtWrapper_QTreeWidgetItem::setForeground(QTreeWidgetItem* theWrappedObject, int column, const QBrush& brush) { ( theWrappedObject->setForeground(column, brush)); } void PythonQtWrapper_QTreeWidgetItem::setHidden(QTreeWidgetItem* theWrappedObject, bool hide) { ( theWrappedObject->setHidden(hide)); } void PythonQtWrapper_QTreeWidgetItem::setIcon(QTreeWidgetItem* theWrappedObject, int column, const QIcon& icon) { ( theWrappedObject->setIcon(column, icon)); } void PythonQtWrapper_QTreeWidgetItem::setSelected(QTreeWidgetItem* theWrappedObject, bool select) { ( theWrappedObject->setSelected(select)); } void PythonQtWrapper_QTreeWidgetItem::setSizeHint(QTreeWidgetItem* theWrappedObject, int column, const QSize& size) { ( theWrappedObject->setSizeHint(column, size)); } void PythonQtWrapper_QTreeWidgetItem::setStatusTip(QTreeWidgetItem* theWrappedObject, int column, const QString& statusTip) { ( theWrappedObject->setStatusTip(column, statusTip)); } void PythonQtWrapper_QTreeWidgetItem::setText(QTreeWidgetItem* theWrappedObject, int column, const QString& text) { ( theWrappedObject->setText(column, text)); } void PythonQtWrapper_QTreeWidgetItem::setTextAlignment(QTreeWidgetItem* theWrappedObject, int column, int alignment) { ( theWrappedObject->setTextAlignment(column, alignment)); } void PythonQtWrapper_QTreeWidgetItem::setToolTip(QTreeWidgetItem* theWrappedObject, int column, const QString& toolTip) { ( theWrappedObject->setToolTip(column, toolTip)); } void PythonQtWrapper_QTreeWidgetItem::setWhatsThis(QTreeWidgetItem* theWrappedObject, int column, const QString& whatsThis) { ( theWrappedObject->setWhatsThis(column, whatsThis)); } QSize PythonQtWrapper_QTreeWidgetItem::sizeHint(QTreeWidgetItem* theWrappedObject, int column) const { return ( theWrappedObject->sizeHint(column)); } void PythonQtWrapper_QTreeWidgetItem::sortChildren(QTreeWidgetItem* theWrappedObject, int column, Qt::SortOrder order) { ( theWrappedObject->sortChildren(column, order)); } QString PythonQtWrapper_QTreeWidgetItem::statusTip(QTreeWidgetItem* theWrappedObject, int column) const { return ( theWrappedObject->statusTip(column)); } QTreeWidgetItem* PythonQtWrapper_QTreeWidgetItem::takeChild(QTreeWidgetItem* theWrappedObject, int index) { return ( theWrappedObject->takeChild(index)); } QList<QTreeWidgetItem* > PythonQtWrapper_QTreeWidgetItem::takeChildren(QTreeWidgetItem* theWrappedObject) { return ( theWrappedObject->takeChildren()); } QString PythonQtWrapper_QTreeWidgetItem::text(QTreeWidgetItem* theWrappedObject, int column) const { return ( theWrappedObject->text(column)); } int PythonQtWrapper_QTreeWidgetItem::textAlignment(QTreeWidgetItem* theWrappedObject, int column) const { return ( theWrappedObject->textAlignment(column)); } QString PythonQtWrapper_QTreeWidgetItem::toolTip(QTreeWidgetItem* theWrappedObject, int column) const { return ( theWrappedObject->toolTip(column)); } QTreeWidget* PythonQtWrapper_QTreeWidgetItem::treeWidget(QTreeWidgetItem* theWrappedObject) const { return ( theWrappedObject->treeWidget()); } int PythonQtWrapper_QTreeWidgetItem::type(QTreeWidgetItem* theWrappedObject) const { return ( theWrappedObject->type()); } QString PythonQtWrapper_QTreeWidgetItem::whatsThis(QTreeWidgetItem* theWrappedObject, int column) const { return ( theWrappedObject->whatsThis(column)); } int PythonQtShell_QUndoCommand::id() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "id"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); int returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("id", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QUndoCommand::id(); } bool PythonQtShell_QUndoCommand::mergeWith(const QUndoCommand* other) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mergeWith"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "const QUndoCommand*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); bool returnValue; void* args[2] = {NULL, (void*)&other}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("mergeWith", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QUndoCommand::mergeWith(other); } void PythonQtShell_QUndoCommand::redo() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "redo"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={""}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoCommand::redo(); } void PythonQtShell_QUndoCommand::undo() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "undo"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={""}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoCommand::undo(); } QUndoCommand* PythonQtWrapper_QUndoCommand::new_QUndoCommand(QUndoCommand* parent) { return new PythonQtShell_QUndoCommand(parent); } QUndoCommand* PythonQtWrapper_QUndoCommand::new_QUndoCommand(const QString& text, QUndoCommand* parent) { return new PythonQtShell_QUndoCommand(text, parent); } QString PythonQtWrapper_QUndoCommand::actionText(QUndoCommand* theWrappedObject) const { return ( theWrappedObject->actionText()); } const QUndoCommand* PythonQtWrapper_QUndoCommand::child(QUndoCommand* theWrappedObject, int index) const { return ( theWrappedObject->child(index)); } int PythonQtWrapper_QUndoCommand::childCount(QUndoCommand* theWrappedObject) const { return ( theWrappedObject->childCount()); } int PythonQtWrapper_QUndoCommand::id(QUndoCommand* theWrappedObject) const { return ( ((PythonQtPublicPromoter_QUndoCommand*)theWrappedObject)->promoted_id()); } bool PythonQtWrapper_QUndoCommand::mergeWith(QUndoCommand* theWrappedObject, const QUndoCommand* other) { return ( ((PythonQtPublicPromoter_QUndoCommand*)theWrappedObject)->promoted_mergeWith(other)); } void PythonQtWrapper_QUndoCommand::redo(QUndoCommand* theWrappedObject) { ( ((PythonQtPublicPromoter_QUndoCommand*)theWrappedObject)->promoted_redo()); } void PythonQtWrapper_QUndoCommand::setText(QUndoCommand* theWrappedObject, const QString& text) { ( theWrappedObject->setText(text)); } QString PythonQtWrapper_QUndoCommand::text(QUndoCommand* theWrappedObject) const { return ( theWrappedObject->text()); } void PythonQtWrapper_QUndoCommand::undo(QUndoCommand* theWrappedObject) { ( ((PythonQtPublicPromoter_QUndoCommand*)theWrappedObject)->promoted_undo()); } void PythonQtShell_QUndoGroup::childEvent(QChildEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "childEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QChildEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoGroup::childEvent(arg__1); } void PythonQtShell_QUndoGroup::customEvent(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "customEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoGroup::customEvent(arg__1); } bool PythonQtShell_QUndoGroup::event(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "event"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); bool returnValue; void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("event", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QUndoGroup::event(arg__1); } bool PythonQtShell_QUndoGroup::eventFilter(QObject* arg__1, QEvent* arg__2) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "eventFilter"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "QObject*" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); bool returnValue; void* args[3] = {NULL, (void*)&arg__1, (void*)&arg__2}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("eventFilter", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QUndoGroup::eventFilter(arg__1, arg__2); } void PythonQtShell_QUndoGroup::timerEvent(QTimerEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "timerEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QTimerEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoGroup::timerEvent(arg__1); } QUndoGroup* PythonQtWrapper_QUndoGroup::new_QUndoGroup(QObject* parent) { return new PythonQtShell_QUndoGroup(parent); } QUndoStack* PythonQtWrapper_QUndoGroup::activeStack(QUndoGroup* theWrappedObject) const { return ( theWrappedObject->activeStack()); } void PythonQtWrapper_QUndoGroup::addStack(QUndoGroup* theWrappedObject, QUndoStack* stack) { ( theWrappedObject->addStack(stack)); } bool PythonQtWrapper_QUndoGroup::canRedo(QUndoGroup* theWrappedObject) const { return ( theWrappedObject->canRedo()); } bool PythonQtWrapper_QUndoGroup::canUndo(QUndoGroup* theWrappedObject) const { return ( theWrappedObject->canUndo()); } QAction* PythonQtWrapper_QUndoGroup::createRedoAction(QUndoGroup* theWrappedObject, QObject* parent, const QString& prefix) const { return ( theWrappedObject->createRedoAction(parent, prefix)); } QAction* PythonQtWrapper_QUndoGroup::createUndoAction(QUndoGroup* theWrappedObject, QObject* parent, const QString& prefix) const { return ( theWrappedObject->createUndoAction(parent, prefix)); } bool PythonQtWrapper_QUndoGroup::isClean(QUndoGroup* theWrappedObject) const { return ( theWrappedObject->isClean()); } QString PythonQtWrapper_QUndoGroup::redoText(QUndoGroup* theWrappedObject) const { return ( theWrappedObject->redoText()); } void PythonQtWrapper_QUndoGroup::removeStack(QUndoGroup* theWrappedObject, QUndoStack* stack) { ( theWrappedObject->removeStack(stack)); } QList<QUndoStack* > PythonQtWrapper_QUndoGroup::stacks(QUndoGroup* theWrappedObject) const { return ( theWrappedObject->stacks()); } QString PythonQtWrapper_QUndoGroup::undoText(QUndoGroup* theWrappedObject) const { return ( theWrappedObject->undoText()); } void PythonQtShell_QUndoStack::childEvent(QChildEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "childEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QChildEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoStack::childEvent(arg__1); } void PythonQtShell_QUndoStack::customEvent(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "customEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoStack::customEvent(arg__1); } bool PythonQtShell_QUndoStack::event(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "event"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); bool returnValue; void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("event", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QUndoStack::event(arg__1); } bool PythonQtShell_QUndoStack::eventFilter(QObject* arg__1, QEvent* arg__2) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "eventFilter"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "QObject*" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); bool returnValue; void* args[3] = {NULL, (void*)&arg__1, (void*)&arg__2}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("eventFilter", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QUndoStack::eventFilter(arg__1, arg__2); } void PythonQtShell_QUndoStack::timerEvent(QTimerEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "timerEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QTimerEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoStack::timerEvent(arg__1); } QUndoStack* PythonQtWrapper_QUndoStack::new_QUndoStack(QObject* parent) { return new PythonQtShell_QUndoStack(parent); } void PythonQtWrapper_QUndoStack::beginMacro(QUndoStack* theWrappedObject, const QString& text) { ( theWrappedObject->beginMacro(text)); } bool PythonQtWrapper_QUndoStack::canRedo(QUndoStack* theWrappedObject) const { return ( theWrappedObject->canRedo()); } bool PythonQtWrapper_QUndoStack::canUndo(QUndoStack* theWrappedObject) const { return ( theWrappedObject->canUndo()); } int PythonQtWrapper_QUndoStack::cleanIndex(QUndoStack* theWrappedObject) const { return ( theWrappedObject->cleanIndex()); } void PythonQtWrapper_QUndoStack::clear(QUndoStack* theWrappedObject) { ( theWrappedObject->clear()); } const QUndoCommand* PythonQtWrapper_QUndoStack::command(QUndoStack* theWrappedObject, int index) const { return ( theWrappedObject->command(index)); } int PythonQtWrapper_QUndoStack::count(QUndoStack* theWrappedObject) const { return ( theWrappedObject->count()); } QAction* PythonQtWrapper_QUndoStack::createRedoAction(QUndoStack* theWrappedObject, QObject* parent, const QString& prefix) const { return ( theWrappedObject->createRedoAction(parent, prefix)); } QAction* PythonQtWrapper_QUndoStack::createUndoAction(QUndoStack* theWrappedObject, QObject* parent, const QString& prefix) const { return ( theWrappedObject->createUndoAction(parent, prefix)); } void PythonQtWrapper_QUndoStack::endMacro(QUndoStack* theWrappedObject) { ( theWrappedObject->endMacro()); } int PythonQtWrapper_QUndoStack::index(QUndoStack* theWrappedObject) const { return ( theWrappedObject->index()); } bool PythonQtWrapper_QUndoStack::isActive(QUndoStack* theWrappedObject) const { return ( theWrappedObject->isActive()); } bool PythonQtWrapper_QUndoStack::isClean(QUndoStack* theWrappedObject) const { return ( theWrappedObject->isClean()); } void PythonQtWrapper_QUndoStack::push(QUndoStack* theWrappedObject, QUndoCommand* cmd) { ( theWrappedObject->push(cmd)); } QString PythonQtWrapper_QUndoStack::redoText(QUndoStack* theWrappedObject) const { return ( theWrappedObject->redoText()); } void PythonQtWrapper_QUndoStack::setUndoLimit(QUndoStack* theWrappedObject, int limit) { ( theWrappedObject->setUndoLimit(limit)); } QString PythonQtWrapper_QUndoStack::text(QUndoStack* theWrappedObject, int idx) const { return ( theWrappedObject->text(idx)); } int PythonQtWrapper_QUndoStack::undoLimit(QUndoStack* theWrappedObject) const { return ( theWrappedObject->undoLimit()); } QString PythonQtWrapper_QUndoStack::undoText(QUndoStack* theWrappedObject) const { return ( theWrappedObject->undoText()); } void PythonQtShell_QUndoView::actionEvent(QActionEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "actionEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QActionEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::actionEvent(arg__1); } void PythonQtShell_QUndoView::changeEvent(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "changeEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::changeEvent(arg__1); } void PythonQtShell_QUndoView::childEvent(QChildEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "childEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QChildEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::childEvent(arg__1); } void PythonQtShell_QUndoView::closeEditor(QWidget* editor, QAbstractItemDelegate::EndEditHint hint) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "closeEditor"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QWidget*" , "QAbstractItemDelegate::EndEditHint"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); void* args[3] = {NULL, (void*)&editor, (void*)&hint}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::closeEditor(editor, hint); } void PythonQtShell_QUndoView::closeEvent(QCloseEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "closeEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QCloseEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::closeEvent(arg__1); } void PythonQtShell_QUndoView::commitData(QWidget* editor) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "commitData"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QWidget*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&editor}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::commitData(editor); } void PythonQtShell_QUndoView::contextMenuEvent(QContextMenuEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "contextMenuEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QContextMenuEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::contextMenuEvent(arg__1); } void PythonQtShell_QUndoView::currentChanged(const QModelIndex& current, const QModelIndex& previous) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "currentChanged"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "const QModelIndex&" , "const QModelIndex&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); void* args[3] = {NULL, (void*)&current, (void*)&previous}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::currentChanged(current, previous); } void PythonQtShell_QUndoView::customEvent(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "customEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::customEvent(arg__1); } void PythonQtShell_QUndoView::dataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dataChanged"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "const QModelIndex&" , "const QModelIndex&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); void* args[3] = {NULL, (void*)&topLeft, (void*)&bottomRight}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::dataChanged(topLeft, bottomRight); } int PythonQtShell_QUndoView::devType() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "devType"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); int returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("devType", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QUndoView::devType(); } void PythonQtShell_QUndoView::doItemsLayout() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "doItemsLayout"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={""}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::doItemsLayout(); } void PythonQtShell_QUndoView::dragEnterEvent(QDragEnterEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dragEnterEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QDragEnterEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::dragEnterEvent(event); } void PythonQtShell_QUndoView::dragLeaveEvent(QDragLeaveEvent* e) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dragLeaveEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QDragLeaveEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&e}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::dragLeaveEvent(e); } void PythonQtShell_QUndoView::dragMoveEvent(QDragMoveEvent* e) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dragMoveEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QDragMoveEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&e}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::dragMoveEvent(e); } void PythonQtShell_QUndoView::dropEvent(QDropEvent* e) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dropEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QDropEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&e}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::dropEvent(e); } bool PythonQtShell_QUndoView::edit(const QModelIndex& index, QAbstractItemView::EditTrigger trigger, QEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "edit"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "const QModelIndex&" , "QAbstractItemView::EditTrigger" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(4, argumentList); bool returnValue; void* args[4] = {NULL, (void*)&index, (void*)&trigger, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("edit", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QUndoView::edit(index, trigger, event); } void PythonQtShell_QUndoView::editorDestroyed(QObject* editor) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "editorDestroyed"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QObject*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&editor}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::editorDestroyed(editor); } void PythonQtShell_QUndoView::enterEvent(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "enterEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::enterEvent(arg__1); } bool PythonQtShell_QUndoView::event(QEvent* e) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "event"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); bool returnValue; void* args[2] = {NULL, (void*)&e}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("event", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QUndoView::event(e); } bool PythonQtShell_QUndoView::eventFilter(QObject* arg__1, QEvent* arg__2) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "eventFilter"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "QObject*" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); bool returnValue; void* args[3] = {NULL, (void*)&arg__1, (void*)&arg__2}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("eventFilter", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QUndoView::eventFilter(arg__1, arg__2); } void PythonQtShell_QUndoView::focusInEvent(QFocusEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "focusInEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QFocusEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::focusInEvent(event); } bool PythonQtShell_QUndoView::focusNextPrevChild(bool next) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "focusNextPrevChild"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "bool"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); bool returnValue; void* args[2] = {NULL, (void*)&next}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("focusNextPrevChild", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QUndoView::focusNextPrevChild(next); } void PythonQtShell_QUndoView::focusOutEvent(QFocusEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "focusOutEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QFocusEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::focusOutEvent(event); } int PythonQtShell_QUndoView::heightForWidth(int arg__1) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "heightForWidth"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); int returnValue; void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("heightForWidth", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QUndoView::heightForWidth(arg__1); } void PythonQtShell_QUndoView::hideEvent(QHideEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "hideEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QHideEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::hideEvent(arg__1); } int PythonQtShell_QUndoView::horizontalOffset() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "horizontalOffset"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); int returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("horizontalOffset", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QUndoView::horizontalOffset(); } void PythonQtShell_QUndoView::horizontalScrollbarAction(int action) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "horizontalScrollbarAction"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&action}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::horizontalScrollbarAction(action); } void PythonQtShell_QUndoView::horizontalScrollbarValueChanged(int value) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "horizontalScrollbarValueChanged"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&value}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::horizontalScrollbarValueChanged(value); } QModelIndex PythonQtShell_QUndoView::indexAt(const QPoint& p) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "indexAt"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QModelIndex" , "const QPoint&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); QModelIndex returnValue; void* args[2] = {NULL, (void*)&p}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("indexAt", methodInfo, result); } else { returnValue = *((QModelIndex*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QUndoView::indexAt(p); } void PythonQtShell_QUndoView::inputMethodEvent(QInputMethodEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "inputMethodEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QInputMethodEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::inputMethodEvent(event); } QVariant PythonQtShell_QUndoView::inputMethodQuery(Qt::InputMethodQuery query) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "inputMethodQuery"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QVariant" , "Qt::InputMethodQuery"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); QVariant returnValue; void* args[2] = {NULL, (void*)&query}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("inputMethodQuery", methodInfo, result); } else { returnValue = *((QVariant*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QUndoView::inputMethodQuery(query); } bool PythonQtShell_QUndoView::isIndexHidden(const QModelIndex& index) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "isIndexHidden"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "const QModelIndex&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); bool returnValue; void* args[2] = {NULL, (void*)&index}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("isIndexHidden", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QUndoView::isIndexHidden(index); } void PythonQtShell_QUndoView::keyPressEvent(QKeyEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "keyPressEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QKeyEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::keyPressEvent(event); } void PythonQtShell_QUndoView::keyReleaseEvent(QKeyEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "keyReleaseEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QKeyEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::keyReleaseEvent(arg__1); } void PythonQtShell_QUndoView::keyboardSearch(const QString& search) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "keyboardSearch"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "const QString&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&search}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::keyboardSearch(search); } void PythonQtShell_QUndoView::languageChange() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "languageChange"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={""}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::languageChange(); } void PythonQtShell_QUndoView::leaveEvent(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "leaveEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::leaveEvent(arg__1); } int PythonQtShell_QUndoView::metric(QPaintDevice::PaintDeviceMetric arg__1) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "metric"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int" , "QPaintDevice::PaintDeviceMetric"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); int returnValue; void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("metric", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QUndoView::metric(arg__1); } void PythonQtShell_QUndoView::mouseDoubleClickEvent(QMouseEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mouseDoubleClickEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QMouseEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::mouseDoubleClickEvent(event); } void PythonQtShell_QUndoView::mouseMoveEvent(QMouseEvent* e) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mouseMoveEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QMouseEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&e}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::mouseMoveEvent(e); } void PythonQtShell_QUndoView::mousePressEvent(QMouseEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mousePressEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QMouseEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::mousePressEvent(event); } void PythonQtShell_QUndoView::mouseReleaseEvent(QMouseEvent* e) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mouseReleaseEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QMouseEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&e}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::mouseReleaseEvent(e); } void PythonQtShell_QUndoView::moveEvent(QMoveEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "moveEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QMoveEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::moveEvent(arg__1); } QPaintEngine* PythonQtShell_QUndoView::paintEngine() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "paintEngine"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QPaintEngine*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); QPaintEngine* returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("paintEngine", methodInfo, result); } else { returnValue = *((QPaintEngine**)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QUndoView::paintEngine(); } void PythonQtShell_QUndoView::paintEvent(QPaintEvent* e) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "paintEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QPaintEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&e}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::paintEvent(e); } void PythonQtShell_QUndoView::reset() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "reset"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={""}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::reset(); } void PythonQtShell_QUndoView::resizeEvent(QResizeEvent* e) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "resizeEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QResizeEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&e}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::resizeEvent(e); } void PythonQtShell_QUndoView::rowsAboutToBeRemoved(const QModelIndex& parent, int start, int end) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "rowsAboutToBeRemoved"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "const QModelIndex&" , "int" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(4, argumentList); void* args[4] = {NULL, (void*)&parent, (void*)&start, (void*)&end}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::rowsAboutToBeRemoved(parent, start, end); } void PythonQtShell_QUndoView::rowsInserted(const QModelIndex& parent, int start, int end) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "rowsInserted"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "const QModelIndex&" , "int" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(4, argumentList); void* args[4] = {NULL, (void*)&parent, (void*)&start, (void*)&end}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::rowsInserted(parent, start, end); } void PythonQtShell_QUndoView::scrollContentsBy(int dx, int dy) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "scrollContentsBy"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "int" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); void* args[3] = {NULL, (void*)&dx, (void*)&dy}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::scrollContentsBy(dx, dy); } void PythonQtShell_QUndoView::scrollTo(const QModelIndex& index, QAbstractItemView::ScrollHint hint) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "scrollTo"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "const QModelIndex&" , "QAbstractItemView::ScrollHint"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); void* args[3] = {NULL, (void*)&index, (void*)&hint}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::scrollTo(index, hint); } void PythonQtShell_QUndoView::selectAll() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "selectAll"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={""}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::selectAll(); } QList<QModelIndex > PythonQtShell_QUndoView::selectedIndexes() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "selectedIndexes"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QList<QModelIndex >"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); QList<QModelIndex > returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("selectedIndexes", methodInfo, result); } else { returnValue = *((QList<QModelIndex >*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QUndoView::selectedIndexes(); } void PythonQtShell_QUndoView::selectionChanged(const QItemSelection& selected, const QItemSelection& deselected) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "selectionChanged"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "const QItemSelection&" , "const QItemSelection&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); void* args[3] = {NULL, (void*)&selected, (void*)&deselected}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::selectionChanged(selected, deselected); } QItemSelectionModel::SelectionFlags PythonQtShell_QUndoView::selectionCommand(const QModelIndex& index, const QEvent* event) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "selectionCommand"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QItemSelectionModel::SelectionFlags" , "const QModelIndex&" , "const QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); QItemSelectionModel::SelectionFlags returnValue; void* args[3] = {NULL, (void*)&index, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("selectionCommand", methodInfo, result); } else { returnValue = *((QItemSelectionModel::SelectionFlags*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QUndoView::selectionCommand(index, event); } void PythonQtShell_QUndoView::setModel(QAbstractItemModel* model) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "setModel"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QAbstractItemModel*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&model}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::setModel(model); } void PythonQtShell_QUndoView::setRootIndex(const QModelIndex& index) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "setRootIndex"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "const QModelIndex&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&index}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::setRootIndex(index); } void PythonQtShell_QUndoView::setSelection(const QRect& rect, QItemSelectionModel::SelectionFlags command) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "setSelection"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "const QRect&" , "QItemSelectionModel::SelectionFlags"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); void* args[3] = {NULL, (void*)&rect, (void*)&command}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::setSelection(rect, command); } void PythonQtShell_QUndoView::setSelectionModel(QItemSelectionModel* selectionModel) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "setSelectionModel"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QItemSelectionModel*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&selectionModel}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::setSelectionModel(selectionModel); } void PythonQtShell_QUndoView::showEvent(QShowEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "showEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QShowEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::showEvent(arg__1); } int PythonQtShell_QUndoView::sizeHintForColumn(int column) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "sizeHintForColumn"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); int returnValue; void* args[2] = {NULL, (void*)&column}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("sizeHintForColumn", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QUndoView::sizeHintForColumn(column); } int PythonQtShell_QUndoView::sizeHintForRow(int row) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "sizeHintForRow"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); int returnValue; void* args[2] = {NULL, (void*)&row}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("sizeHintForRow", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QUndoView::sizeHintForRow(row); } void PythonQtShell_QUndoView::startDrag(Qt::DropActions supportedActions) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "startDrag"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "Qt::DropActions"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&supportedActions}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::startDrag(supportedActions); } void PythonQtShell_QUndoView::tabletEvent(QTabletEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "tabletEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QTabletEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::tabletEvent(arg__1); } void PythonQtShell_QUndoView::timerEvent(QTimerEvent* e) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "timerEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QTimerEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&e}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::timerEvent(e); } void PythonQtShell_QUndoView::updateEditorData() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "updateEditorData"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={""}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::updateEditorData(); } void PythonQtShell_QUndoView::updateEditorGeometries() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "updateEditorGeometries"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={""}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::updateEditorGeometries(); } void PythonQtShell_QUndoView::updateGeometries() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "updateGeometries"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={""}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::updateGeometries(); } int PythonQtShell_QUndoView::verticalOffset() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "verticalOffset"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); int returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("verticalOffset", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QUndoView::verticalOffset(); } void PythonQtShell_QUndoView::verticalScrollbarAction(int action) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "verticalScrollbarAction"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&action}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::verticalScrollbarAction(action); } void PythonQtShell_QUndoView::verticalScrollbarValueChanged(int value) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "verticalScrollbarValueChanged"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&value}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::verticalScrollbarValueChanged(value); } QStyleOptionViewItem PythonQtShell_QUndoView::viewOptions() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "viewOptions"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QStyleOptionViewItem"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); QStyleOptionViewItem returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("viewOptions", methodInfo, result); } else { returnValue = *((QStyleOptionViewItem*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QUndoView::viewOptions(); } bool PythonQtShell_QUndoView::viewportEvent(QEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "viewportEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); bool returnValue; void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("viewportEvent", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QUndoView::viewportEvent(event); } QRect PythonQtShell_QUndoView::visualRect(const QModelIndex& index) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "visualRect"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QRect" , "const QModelIndex&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); QRect returnValue; void* args[2] = {NULL, (void*)&index}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("visualRect", methodInfo, result); } else { returnValue = *((QRect*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QUndoView::visualRect(index); } QRegion PythonQtShell_QUndoView::visualRegionForSelection(const QItemSelection& selection) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "visualRegionForSelection"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QRegion" , "const QItemSelection&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); QRegion returnValue; void* args[2] = {NULL, (void*)&selection}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("visualRegionForSelection", methodInfo, result); } else { returnValue = *((QRegion*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QUndoView::visualRegionForSelection(selection); } void PythonQtShell_QUndoView::wheelEvent(QWheelEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "wheelEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QWheelEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QUndoView::wheelEvent(arg__1); } QUndoView* PythonQtWrapper_QUndoView::new_QUndoView(QUndoGroup* group, QWidget* parent) { return new PythonQtShell_QUndoView(group, parent); } QUndoView* PythonQtWrapper_QUndoView::new_QUndoView(QUndoStack* stack, QWidget* parent) { return new PythonQtShell_QUndoView(stack, parent); } QUndoView* PythonQtWrapper_QUndoView::new_QUndoView(QWidget* parent) { return new PythonQtShell_QUndoView(parent); } QIcon PythonQtWrapper_QUndoView::cleanIcon(QUndoView* theWrappedObject) const { return ( theWrappedObject->cleanIcon()); } QString PythonQtWrapper_QUndoView::emptyLabel(QUndoView* theWrappedObject) const { return ( theWrappedObject->emptyLabel()); } QUndoGroup* PythonQtWrapper_QUndoView::group(QUndoView* theWrappedObject) const { return ( theWrappedObject->group()); } void PythonQtWrapper_QUndoView::setCleanIcon(QUndoView* theWrappedObject, const QIcon& icon) { ( theWrappedObject->setCleanIcon(icon)); } void PythonQtWrapper_QUndoView::setEmptyLabel(QUndoView* theWrappedObject, const QString& label) { ( theWrappedObject->setEmptyLabel(label)); } QUndoStack* PythonQtWrapper_QUndoView::stack(QUndoView* theWrappedObject) const { return ( theWrappedObject->stack()); } void PythonQtShell_QVBoxLayout::addItem(QLayoutItem* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "addItem"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QLayoutItem*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QVBoxLayout::addItem(arg__1); } void PythonQtShell_QVBoxLayout::childEvent(QChildEvent* e) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "childEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QChildEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&e}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QVBoxLayout::childEvent(e); } int PythonQtShell_QVBoxLayout::count() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "count"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); int returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("count", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QVBoxLayout::count(); } void PythonQtShell_QVBoxLayout::customEvent(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "customEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QVBoxLayout::customEvent(arg__1); } bool PythonQtShell_QVBoxLayout::event(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "event"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); bool returnValue; void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("event", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QVBoxLayout::event(arg__1); } bool PythonQtShell_QVBoxLayout::eventFilter(QObject* arg__1, QEvent* arg__2) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "eventFilter"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "QObject*" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); bool returnValue; void* args[3] = {NULL, (void*)&arg__1, (void*)&arg__2}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("eventFilter", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QVBoxLayout::eventFilter(arg__1, arg__2); } Qt::Orientations PythonQtShell_QVBoxLayout::expandingDirections() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "expandingDirections"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"Qt::Orientations"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); Qt::Orientations returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("expandingDirections", methodInfo, result); } else { returnValue = *((Qt::Orientations*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QVBoxLayout::expandingDirections(); } QRect PythonQtShell_QVBoxLayout::geometry() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "geometry"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QRect"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); QRect returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("geometry", methodInfo, result); } else { returnValue = *((QRect*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QVBoxLayout::geometry(); } int PythonQtShell_QVBoxLayout::indexOf(QWidget* arg__1) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "indexOf"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int" , "QWidget*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); int returnValue; void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("indexOf", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QVBoxLayout::indexOf(arg__1); } void PythonQtShell_QVBoxLayout::invalidate() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "invalidate"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={""}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QVBoxLayout::invalidate(); } bool PythonQtShell_QVBoxLayout::isEmpty() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "isEmpty"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); bool returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("isEmpty", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QVBoxLayout::isEmpty(); } QLayoutItem* PythonQtShell_QVBoxLayout::itemAt(int arg__1) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "itemAt"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QLayoutItem*" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); QLayoutItem* returnValue; void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("itemAt", methodInfo, result); } else { returnValue = *((QLayoutItem**)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QVBoxLayout::itemAt(arg__1); } QLayout* PythonQtShell_QVBoxLayout::layout() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "layout"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QLayout*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); QLayout* returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("layout", methodInfo, result); } else { returnValue = *((QLayout**)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QVBoxLayout::layout(); } QSize PythonQtShell_QVBoxLayout::maximumSize() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "maximumSize"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QSize"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); QSize returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("maximumSize", methodInfo, result); } else { returnValue = *((QSize*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QVBoxLayout::maximumSize(); } QSize PythonQtShell_QVBoxLayout::minimumSize() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "minimumSize"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QSize"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); QSize returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("minimumSize", methodInfo, result); } else { returnValue = *((QSize*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QVBoxLayout::minimumSize(); } void PythonQtShell_QVBoxLayout::setGeometry(const QRect& arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "setGeometry"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "const QRect&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QVBoxLayout::setGeometry(arg__1); } QLayoutItem* PythonQtShell_QVBoxLayout::takeAt(int arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "takeAt"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QLayoutItem*" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); QLayoutItem* returnValue; void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("takeAt", methodInfo, result); } else { returnValue = *((QLayoutItem**)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QVBoxLayout::takeAt(arg__1); } void PythonQtShell_QVBoxLayout::timerEvent(QTimerEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "timerEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QTimerEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QVBoxLayout::timerEvent(arg__1); } QVBoxLayout* PythonQtWrapper_QVBoxLayout::new_QVBoxLayout() { return new PythonQtShell_QVBoxLayout(); } QVBoxLayout* PythonQtWrapper_QVBoxLayout::new_QVBoxLayout(QWidget* parent) { return new PythonQtShell_QVBoxLayout(parent); } void PythonQtShell_QValidator::childEvent(QChildEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "childEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QChildEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QValidator::childEvent(arg__1); } void PythonQtShell_QValidator::customEvent(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "customEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QValidator::customEvent(arg__1); } bool PythonQtShell_QValidator::event(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "event"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); bool returnValue; void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("event", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QValidator::event(arg__1); } bool PythonQtShell_QValidator::eventFilter(QObject* arg__1, QEvent* arg__2) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "eventFilter"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "QObject*" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); bool returnValue; void* args[3] = {NULL, (void*)&arg__1, (void*)&arg__2}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("eventFilter", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QValidator::eventFilter(arg__1, arg__2); } void PythonQtShell_QValidator::fixup(QString& arg__1) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "fixup"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QString&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QValidator::fixup(arg__1); } void PythonQtShell_QValidator::timerEvent(QTimerEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "timerEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QTimerEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QValidator::timerEvent(arg__1); } QValidator::State PythonQtShell_QValidator::validate(QString& arg__1, int& arg__2) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "validate"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QValidator::State" , "QString&" , "int&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); QValidator::State returnValue; void* args[3] = {NULL, (void*)&arg__1, (void*)&arg__2}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("validate", methodInfo, result); } else { returnValue = *((QValidator::State*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QValidator::State(); } QValidator* PythonQtWrapper_QValidator::new_QValidator(QObject* parent) { return new PythonQtShell_QValidator(parent); } void PythonQtWrapper_QValidator::fixup(QValidator* theWrappedObject, QString& arg__1) const { ( ((PythonQtPublicPromoter_QValidator*)theWrappedObject)->promoted_fixup(arg__1)); } QLocale PythonQtWrapper_QValidator::locale(QValidator* theWrappedObject) const { return ( theWrappedObject->locale()); } void PythonQtWrapper_QValidator::setLocale(QValidator* theWrappedObject, const QLocale& locale) { ( theWrappedObject->setLocale(locale)); } QVector2D* PythonQtWrapper_QVector2D::new_QVector2D() { return new QVector2D(); } QVector2D* PythonQtWrapper_QVector2D::new_QVector2D(const QPoint& point) { return new QVector2D(point); } QVector2D* PythonQtWrapper_QVector2D::new_QVector2D(const QPointF& point) { return new QVector2D(point); } QVector2D* PythonQtWrapper_QVector2D::new_QVector2D(const QVector3D& vector) { return new QVector2D(vector); } QVector2D* PythonQtWrapper_QVector2D::new_QVector2D(const QVector4D& vector) { return new QVector2D(vector); } QVector2D* PythonQtWrapper_QVector2D::new_QVector2D(qreal xpos, qreal ypos) { return new QVector2D(xpos, ypos); } qreal PythonQtWrapper_QVector2D::static_QVector2D_dotProduct(const QVector2D& v1, const QVector2D& v2) { return (QVector2D::dotProduct(v1, v2)); } bool PythonQtWrapper_QVector2D::isNull(QVector2D* theWrappedObject) const { return ( theWrappedObject->isNull()); } qreal PythonQtWrapper_QVector2D::length(QVector2D* theWrappedObject) const { return ( theWrappedObject->length()); } qreal PythonQtWrapper_QVector2D::lengthSquared(QVector2D* theWrappedObject) const { return ( theWrappedObject->lengthSquared()); } void PythonQtWrapper_QVector2D::normalize(QVector2D* theWrappedObject) { ( theWrappedObject->normalize()); } QVector2D PythonQtWrapper_QVector2D::normalized(QVector2D* theWrappedObject) const { return ( theWrappedObject->normalized()); } const QVector2D PythonQtWrapper_QVector2D::__mul__(QVector2D* theWrappedObject, const QVector2D& v2) { return ( (*theWrappedObject)* v2); } const QVector2D PythonQtWrapper_QVector2D::__mul__(QVector2D* theWrappedObject, qreal factor) { return ( (*theWrappedObject)* factor); } QVector2D* PythonQtWrapper_QVector2D::__imul__(QVector2D* theWrappedObject, const QVector2D& vector) { return &( (*theWrappedObject)*= vector); } QVector2D* PythonQtWrapper_QVector2D::__imul__(QVector2D* theWrappedObject, qreal factor) { return &( (*theWrappedObject)*= factor); } const QVector2D PythonQtWrapper_QVector2D::__add__(QVector2D* theWrappedObject, const QVector2D& v2) { return ( (*theWrappedObject)+ v2); } QVector2D* PythonQtWrapper_QVector2D::__iadd__(QVector2D* theWrappedObject, const QVector2D& vector) { return &( (*theWrappedObject)+= vector); } const QVector2D PythonQtWrapper_QVector2D::__sub__(QVector2D* theWrappedObject, const QVector2D& v2) { return ( (*theWrappedObject)- v2); } QVector2D* PythonQtWrapper_QVector2D::__isub__(QVector2D* theWrappedObject, const QVector2D& vector) { return &( (*theWrappedObject)-= vector); } const QVector2D PythonQtWrapper_QVector2D::__div__(QVector2D* theWrappedObject, qreal divisor) { return ( (*theWrappedObject)/ divisor); } QVector2D* PythonQtWrapper_QVector2D::__idiv__(QVector2D* theWrappedObject, qreal divisor) { return &( (*theWrappedObject)/= divisor); } void PythonQtWrapper_QVector2D::writeTo(QVector2D* theWrappedObject, QDataStream& arg__1) { arg__1 << (*theWrappedObject); } bool PythonQtWrapper_QVector2D::__eq__(QVector2D* theWrappedObject, const QVector2D& v2) { return ( (*theWrappedObject)== v2); } void PythonQtWrapper_QVector2D::readFrom(QVector2D* theWrappedObject, QDataStream& arg__1) { arg__1 >> (*theWrappedObject); } void PythonQtWrapper_QVector2D::setX(QVector2D* theWrappedObject, qreal x) { ( theWrappedObject->setX(x)); } void PythonQtWrapper_QVector2D::setY(QVector2D* theWrappedObject, qreal y) { ( theWrappedObject->setY(y)); } QPoint PythonQtWrapper_QVector2D::toPoint(QVector2D* theWrappedObject) const { return ( theWrappedObject->toPoint()); } QPointF PythonQtWrapper_QVector2D::toPointF(QVector2D* theWrappedObject) const { return ( theWrappedObject->toPointF()); } QVector3D PythonQtWrapper_QVector2D::toVector3D(QVector2D* theWrappedObject) const { return ( theWrappedObject->toVector3D()); } QVector4D PythonQtWrapper_QVector2D::toVector4D(QVector2D* theWrappedObject) const { return ( theWrappedObject->toVector4D()); } qreal PythonQtWrapper_QVector2D::x(QVector2D* theWrappedObject) const { return ( theWrappedObject->x()); } qreal PythonQtWrapper_QVector2D::y(QVector2D* theWrappedObject) const { return ( theWrappedObject->y()); } QString PythonQtWrapper_QVector2D::py_toString(QVector2D* obj) { QString result; QDebug d(&result); d << *obj; return result; } QVector3D* PythonQtWrapper_QVector3D::new_QVector3D() { return new QVector3D(); } QVector3D* PythonQtWrapper_QVector3D::new_QVector3D(const QPoint& point) { return new QVector3D(point); } QVector3D* PythonQtWrapper_QVector3D::new_QVector3D(const QPointF& point) { return new QVector3D(point); } QVector3D* PythonQtWrapper_QVector3D::new_QVector3D(const QVector2D& vector) { return new QVector3D(vector); } QVector3D* PythonQtWrapper_QVector3D::new_QVector3D(const QVector2D& vector, qreal zpos) { return new QVector3D(vector, zpos); } QVector3D* PythonQtWrapper_QVector3D::new_QVector3D(const QVector4D& vector) { return new QVector3D(vector); } QVector3D* PythonQtWrapper_QVector3D::new_QVector3D(qreal xpos, qreal ypos, qreal zpos) { return new QVector3D(xpos, ypos, zpos); } QVector3D PythonQtWrapper_QVector3D::static_QVector3D_crossProduct(const QVector3D& v1, const QVector3D& v2) { return (QVector3D::crossProduct(v1, v2)); } qreal PythonQtWrapper_QVector3D::distanceToLine(QVector3D* theWrappedObject, const QVector3D& point, const QVector3D& direction) const { return ( theWrappedObject->distanceToLine(point, direction)); } qreal PythonQtWrapper_QVector3D::distanceToPlane(QVector3D* theWrappedObject, const QVector3D& plane, const QVector3D& normal) const { return ( theWrappedObject->distanceToPlane(plane, normal)); } qreal PythonQtWrapper_QVector3D::distanceToPlane(QVector3D* theWrappedObject, const QVector3D& plane1, const QVector3D& plane2, const QVector3D& plane3) const { return ( theWrappedObject->distanceToPlane(plane1, plane2, plane3)); } qreal PythonQtWrapper_QVector3D::static_QVector3D_dotProduct(const QVector3D& v1, const QVector3D& v2) { return (QVector3D::dotProduct(v1, v2)); } bool PythonQtWrapper_QVector3D::isNull(QVector3D* theWrappedObject) const { return ( theWrappedObject->isNull()); } qreal PythonQtWrapper_QVector3D::length(QVector3D* theWrappedObject) const { return ( theWrappedObject->length()); } qreal PythonQtWrapper_QVector3D::lengthSquared(QVector3D* theWrappedObject) const { return ( theWrappedObject->lengthSquared()); } QVector3D PythonQtWrapper_QVector3D::static_QVector3D_normal(const QVector3D& v1, const QVector3D& v2) { return (QVector3D::normal(v1, v2)); } QVector3D PythonQtWrapper_QVector3D::static_QVector3D_normal(const QVector3D& v1, const QVector3D& v2, const QVector3D& v3) { return (QVector3D::normal(v1, v2, v3)); } void PythonQtWrapper_QVector3D::normalize(QVector3D* theWrappedObject) { ( theWrappedObject->normalize()); } QVector3D PythonQtWrapper_QVector3D::normalized(QVector3D* theWrappedObject) const { return ( theWrappedObject->normalized()); } QVector3D PythonQtWrapper_QVector3D::__mul__(QVector3D* theWrappedObject, const QMatrix4x4& matrix) { return ( (*theWrappedObject)* matrix); } const QVector3D PythonQtWrapper_QVector3D::__mul__(QVector3D* theWrappedObject, const QVector3D& v2) { return ( (*theWrappedObject)* v2); } const QVector3D PythonQtWrapper_QVector3D::__mul__(QVector3D* theWrappedObject, qreal factor) { return ( (*theWrappedObject)* factor); } QVector3D* PythonQtWrapper_QVector3D::__imul__(QVector3D* theWrappedObject, const QVector3D& vector) { return &( (*theWrappedObject)*= vector); } QVector3D* PythonQtWrapper_QVector3D::__imul__(QVector3D* theWrappedObject, qreal factor) { return &( (*theWrappedObject)*= factor); } const QVector3D PythonQtWrapper_QVector3D::__add__(QVector3D* theWrappedObject, const QVector3D& v2) { return ( (*theWrappedObject)+ v2); } QVector3D* PythonQtWrapper_QVector3D::__iadd__(QVector3D* theWrappedObject, const QVector3D& vector) { return &( (*theWrappedObject)+= vector); } const QVector3D PythonQtWrapper_QVector3D::__sub__(QVector3D* theWrappedObject, const QVector3D& v2) { return ( (*theWrappedObject)- v2); } QVector3D* PythonQtWrapper_QVector3D::__isub__(QVector3D* theWrappedObject, const QVector3D& vector) { return &( (*theWrappedObject)-= vector); } const QVector3D PythonQtWrapper_QVector3D::__div__(QVector3D* theWrappedObject, qreal divisor) { return ( (*theWrappedObject)/ divisor); } QVector3D* PythonQtWrapper_QVector3D::__idiv__(QVector3D* theWrappedObject, qreal divisor) { return &( (*theWrappedObject)/= divisor); } void PythonQtWrapper_QVector3D::writeTo(QVector3D* theWrappedObject, QDataStream& arg__1) { arg__1 << (*theWrappedObject); } bool PythonQtWrapper_QVector3D::__eq__(QVector3D* theWrappedObject, const QVector3D& v2) { return ( (*theWrappedObject)== v2); } void PythonQtWrapper_QVector3D::readFrom(QVector3D* theWrappedObject, QDataStream& arg__1) { arg__1 >> (*theWrappedObject); } void PythonQtWrapper_QVector3D::setX(QVector3D* theWrappedObject, qreal x) { ( theWrappedObject->setX(x)); } void PythonQtWrapper_QVector3D::setY(QVector3D* theWrappedObject, qreal y) { ( theWrappedObject->setY(y)); } void PythonQtWrapper_QVector3D::setZ(QVector3D* theWrappedObject, qreal z) { ( theWrappedObject->setZ(z)); } QPoint PythonQtWrapper_QVector3D::toPoint(QVector3D* theWrappedObject) const { return ( theWrappedObject->toPoint()); } QPointF PythonQtWrapper_QVector3D::toPointF(QVector3D* theWrappedObject) const { return ( theWrappedObject->toPointF()); } QVector2D PythonQtWrapper_QVector3D::toVector2D(QVector3D* theWrappedObject) const { return ( theWrappedObject->toVector2D()); } QVector4D PythonQtWrapper_QVector3D::toVector4D(QVector3D* theWrappedObject) const { return ( theWrappedObject->toVector4D()); } qreal PythonQtWrapper_QVector3D::x(QVector3D* theWrappedObject) const { return ( theWrappedObject->x()); } qreal PythonQtWrapper_QVector3D::y(QVector3D* theWrappedObject) const { return ( theWrappedObject->y()); } qreal PythonQtWrapper_QVector3D::z(QVector3D* theWrappedObject) const { return ( theWrappedObject->z()); } QString PythonQtWrapper_QVector3D::py_toString(QVector3D* obj) { QString result; QDebug d(&result); d << *obj; return result; } QVector4D* PythonQtWrapper_QVector4D::new_QVector4D() { return new QVector4D(); } QVector4D* PythonQtWrapper_QVector4D::new_QVector4D(const QPoint& point) { return new QVector4D(point); } QVector4D* PythonQtWrapper_QVector4D::new_QVector4D(const QPointF& point) { return new QVector4D(point); } QVector4D* PythonQtWrapper_QVector4D::new_QVector4D(const QVector2D& vector) { return new QVector4D(vector); } QVector4D* PythonQtWrapper_QVector4D::new_QVector4D(const QVector2D& vector, qreal zpos, qreal wpos) { return new QVector4D(vector, zpos, wpos); } QVector4D* PythonQtWrapper_QVector4D::new_QVector4D(const QVector3D& vector) { return new QVector4D(vector); } QVector4D* PythonQtWrapper_QVector4D::new_QVector4D(const QVector3D& vector, qreal wpos) { return new QVector4D(vector, wpos); } QVector4D* PythonQtWrapper_QVector4D::new_QVector4D(qreal xpos, qreal ypos, qreal zpos, qreal wpos) { return new QVector4D(xpos, ypos, zpos, wpos); } qreal PythonQtWrapper_QVector4D::static_QVector4D_dotProduct(const QVector4D& v1, const QVector4D& v2) { return (QVector4D::dotProduct(v1, v2)); } bool PythonQtWrapper_QVector4D::isNull(QVector4D* theWrappedObject) const { return ( theWrappedObject->isNull()); } qreal PythonQtWrapper_QVector4D::length(QVector4D* theWrappedObject) const { return ( theWrappedObject->length()); } qreal PythonQtWrapper_QVector4D::lengthSquared(QVector4D* theWrappedObject) const { return ( theWrappedObject->lengthSquared()); } void PythonQtWrapper_QVector4D::normalize(QVector4D* theWrappedObject) { ( theWrappedObject->normalize()); } QVector4D PythonQtWrapper_QVector4D::normalized(QVector4D* theWrappedObject) const { return ( theWrappedObject->normalized()); } QVector4D PythonQtWrapper_QVector4D::__mul__(QVector4D* theWrappedObject, const QMatrix4x4& matrix) { return ( (*theWrappedObject)* matrix); } const QVector4D PythonQtWrapper_QVector4D::__mul__(QVector4D* theWrappedObject, const QVector4D& v2) { return ( (*theWrappedObject)* v2); } const QVector4D PythonQtWrapper_QVector4D::__mul__(QVector4D* theWrappedObject, qreal factor) { return ( (*theWrappedObject)* factor); } QVector4D* PythonQtWrapper_QVector4D::__imul__(QVector4D* theWrappedObject, const QVector4D& vector) { return &( (*theWrappedObject)*= vector); } QVector4D* PythonQtWrapper_QVector4D::__imul__(QVector4D* theWrappedObject, qreal factor) { return &( (*theWrappedObject)*= factor); } const QVector4D PythonQtWrapper_QVector4D::__add__(QVector4D* theWrappedObject, const QVector4D& v2) { return ( (*theWrappedObject)+ v2); } QVector4D* PythonQtWrapper_QVector4D::__iadd__(QVector4D* theWrappedObject, const QVector4D& vector) { return &( (*theWrappedObject)+= vector); } const QVector4D PythonQtWrapper_QVector4D::__sub__(QVector4D* theWrappedObject, const QVector4D& v2) { return ( (*theWrappedObject)- v2); } QVector4D* PythonQtWrapper_QVector4D::__isub__(QVector4D* theWrappedObject, const QVector4D& vector) { return &( (*theWrappedObject)-= vector); } const QVector4D PythonQtWrapper_QVector4D::__div__(QVector4D* theWrappedObject, qreal divisor) { return ( (*theWrappedObject)/ divisor); } QVector4D* PythonQtWrapper_QVector4D::__idiv__(QVector4D* theWrappedObject, qreal divisor) { return &( (*theWrappedObject)/= divisor); } void PythonQtWrapper_QVector4D::writeTo(QVector4D* theWrappedObject, QDataStream& arg__1) { arg__1 << (*theWrappedObject); } bool PythonQtWrapper_QVector4D::__eq__(QVector4D* theWrappedObject, const QVector4D& v2) { return ( (*theWrappedObject)== v2); } void PythonQtWrapper_QVector4D::readFrom(QVector4D* theWrappedObject, QDataStream& arg__1) { arg__1 >> (*theWrappedObject); } void PythonQtWrapper_QVector4D::setW(QVector4D* theWrappedObject, qreal w) { ( theWrappedObject->setW(w)); } void PythonQtWrapper_QVector4D::setX(QVector4D* theWrappedObject, qreal x) { ( theWrappedObject->setX(x)); } void PythonQtWrapper_QVector4D::setY(QVector4D* theWrappedObject, qreal y) { ( theWrappedObject->setY(y)); } void PythonQtWrapper_QVector4D::setZ(QVector4D* theWrappedObject, qreal z) { ( theWrappedObject->setZ(z)); } QPoint PythonQtWrapper_QVector4D::toPoint(QVector4D* theWrappedObject) const { return ( theWrappedObject->toPoint()); } QPointF PythonQtWrapper_QVector4D::toPointF(QVector4D* theWrappedObject) const { return ( theWrappedObject->toPointF()); } QVector2D PythonQtWrapper_QVector4D::toVector2D(QVector4D* theWrappedObject) const { return ( theWrappedObject->toVector2D()); } QVector2D PythonQtWrapper_QVector4D::toVector2DAffine(QVector4D* theWrappedObject) const { return ( theWrappedObject->toVector2DAffine()); } QVector3D PythonQtWrapper_QVector4D::toVector3D(QVector4D* theWrappedObject) const { return ( theWrappedObject->toVector3D()); } QVector3D PythonQtWrapper_QVector4D::toVector3DAffine(QVector4D* theWrappedObject) const { return ( theWrappedObject->toVector3DAffine()); } qreal PythonQtWrapper_QVector4D::w(QVector4D* theWrappedObject) const { return ( theWrappedObject->w()); } qreal PythonQtWrapper_QVector4D::x(QVector4D* theWrappedObject) const { return ( theWrappedObject->x()); } qreal PythonQtWrapper_QVector4D::y(QVector4D* theWrappedObject) const { return ( theWrappedObject->y()); } qreal PythonQtWrapper_QVector4D::z(QVector4D* theWrappedObject) const { return ( theWrappedObject->z()); } QString PythonQtWrapper_QVector4D::py_toString(QVector4D* obj) { QString result; QDebug d(&result); d << *obj; return result; } QAction* PythonQtWrapper_QWhatsThis::static_QWhatsThis_createAction(QObject* parent) { return (QWhatsThis::createAction(parent)); } void PythonQtWrapper_QWhatsThis::static_QWhatsThis_enterWhatsThisMode() { (QWhatsThis::enterWhatsThisMode()); } void PythonQtWrapper_QWhatsThis::static_QWhatsThis_hideText() { (QWhatsThis::hideText()); } bool PythonQtWrapper_QWhatsThis::static_QWhatsThis_inWhatsThisMode() { return (QWhatsThis::inWhatsThisMode()); } void PythonQtWrapper_QWhatsThis::static_QWhatsThis_leaveWhatsThisMode() { (QWhatsThis::leaveWhatsThisMode()); } void PythonQtWrapper_QWhatsThis::static_QWhatsThis_showText(const QPoint& pos, const QString& text, QWidget* w) { (QWhatsThis::showText(pos, text, w)); } QWhatsThisClickedEvent* PythonQtWrapper_QWhatsThisClickedEvent::new_QWhatsThisClickedEvent(const QString& href) { return new QWhatsThisClickedEvent(href); } QString PythonQtWrapper_QWhatsThisClickedEvent::href(QWhatsThisClickedEvent* theWrappedObject) const { return ( theWrappedObject->href()); } QWheelEvent* PythonQtWrapper_QWheelEvent::new_QWheelEvent(const QPoint& pos, const QPoint& globalPos, int delta, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::Orientation orient) { return new PythonQtShell_QWheelEvent(pos, globalPos, delta, buttons, modifiers, orient); } QWheelEvent* PythonQtWrapper_QWheelEvent::new_QWheelEvent(const QPoint& pos, int delta, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::Orientation orient) { return new PythonQtShell_QWheelEvent(pos, delta, buttons, modifiers, orient); } Qt::MouseButtons PythonQtWrapper_QWheelEvent::buttons(QWheelEvent* theWrappedObject) const { return ( theWrappedObject->buttons()); } int PythonQtWrapper_QWheelEvent::delta(QWheelEvent* theWrappedObject) const { return ( theWrappedObject->delta()); } const QPoint* PythonQtWrapper_QWheelEvent::globalPos(QWheelEvent* theWrappedObject) const { return &( theWrappedObject->globalPos()); } int PythonQtWrapper_QWheelEvent::globalX(QWheelEvent* theWrappedObject) const { return ( theWrappedObject->globalX()); } int PythonQtWrapper_QWheelEvent::globalY(QWheelEvent* theWrappedObject) const { return ( theWrappedObject->globalY()); } Qt::Orientation PythonQtWrapper_QWheelEvent::orientation(QWheelEvent* theWrappedObject) const { return ( theWrappedObject->orientation()); } const QPoint* PythonQtWrapper_QWheelEvent::pos(QWheelEvent* theWrappedObject) const { return &( theWrappedObject->pos()); } int PythonQtWrapper_QWheelEvent::x(QWheelEvent* theWrappedObject) const { return ( theWrappedObject->x()); } int PythonQtWrapper_QWheelEvent::y(QWheelEvent* theWrappedObject) const { return ( theWrappedObject->y()); } void PythonQtShell_QWidget::actionEvent(QActionEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "actionEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QActionEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidget::actionEvent(arg__1); } void PythonQtShell_QWidget::changeEvent(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "changeEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidget::changeEvent(arg__1); } void PythonQtShell_QWidget::childEvent(QChildEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "childEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QChildEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidget::childEvent(arg__1); } void PythonQtShell_QWidget::closeEvent(QCloseEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "closeEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QCloseEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidget::closeEvent(arg__1); } void PythonQtShell_QWidget::contextMenuEvent(QContextMenuEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "contextMenuEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QContextMenuEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidget::contextMenuEvent(arg__1); } void PythonQtShell_QWidget::customEvent(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "customEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidget::customEvent(arg__1); } int PythonQtShell_QWidget::devType() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "devType"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); int returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("devType", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWidget::devType(); } void PythonQtShell_QWidget::dragEnterEvent(QDragEnterEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dragEnterEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QDragEnterEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidget::dragEnterEvent(arg__1); } void PythonQtShell_QWidget::dragLeaveEvent(QDragLeaveEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dragLeaveEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QDragLeaveEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidget::dragLeaveEvent(arg__1); } void PythonQtShell_QWidget::dragMoveEvent(QDragMoveEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dragMoveEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QDragMoveEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidget::dragMoveEvent(arg__1); } void PythonQtShell_QWidget::dropEvent(QDropEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dropEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QDropEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidget::dropEvent(arg__1); } void PythonQtShell_QWidget::enabledChange(bool arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "enabledChange"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "bool"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidget::enabledChange(arg__1); } void PythonQtShell_QWidget::enterEvent(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "enterEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidget::enterEvent(arg__1); } bool PythonQtShell_QWidget::event(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "event"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); bool returnValue; void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("event", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWidget::event(arg__1); } bool PythonQtShell_QWidget::eventFilter(QObject* arg__1, QEvent* arg__2) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "eventFilter"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "QObject*" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); bool returnValue; void* args[3] = {NULL, (void*)&arg__1, (void*)&arg__2}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("eventFilter", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWidget::eventFilter(arg__1, arg__2); } void PythonQtShell_QWidget::focusInEvent(QFocusEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "focusInEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QFocusEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidget::focusInEvent(arg__1); } bool PythonQtShell_QWidget::focusNextPrevChild(bool next) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "focusNextPrevChild"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "bool"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); bool returnValue; void* args[2] = {NULL, (void*)&next}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("focusNextPrevChild", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWidget::focusNextPrevChild(next); } void PythonQtShell_QWidget::focusOutEvent(QFocusEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "focusOutEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QFocusEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidget::focusOutEvent(arg__1); } void PythonQtShell_QWidget::fontChange(const QFont& arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "fontChange"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "const QFont&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidget::fontChange(arg__1); } int PythonQtShell_QWidget::heightForWidth(int arg__1) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "heightForWidth"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); int returnValue; void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("heightForWidth", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWidget::heightForWidth(arg__1); } void PythonQtShell_QWidget::hideEvent(QHideEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "hideEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QHideEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidget::hideEvent(arg__1); } void PythonQtShell_QWidget::inputMethodEvent(QInputMethodEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "inputMethodEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QInputMethodEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidget::inputMethodEvent(arg__1); } QVariant PythonQtShell_QWidget::inputMethodQuery(Qt::InputMethodQuery arg__1) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "inputMethodQuery"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QVariant" , "Qt::InputMethodQuery"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); QVariant returnValue; void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("inputMethodQuery", methodInfo, result); } else { returnValue = *((QVariant*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWidget::inputMethodQuery(arg__1); } void PythonQtShell_QWidget::keyPressEvent(QKeyEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "keyPressEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QKeyEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidget::keyPressEvent(arg__1); } void PythonQtShell_QWidget::keyReleaseEvent(QKeyEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "keyReleaseEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QKeyEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidget::keyReleaseEvent(arg__1); } void PythonQtShell_QWidget::languageChange() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "languageChange"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={""}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidget::languageChange(); } void PythonQtShell_QWidget::leaveEvent(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "leaveEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidget::leaveEvent(arg__1); } int PythonQtShell_QWidget::metric(QPaintDevice::PaintDeviceMetric arg__1) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "metric"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int" , "QPaintDevice::PaintDeviceMetric"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); int returnValue; void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("metric", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWidget::metric(arg__1); } QSize PythonQtShell_QWidget::minimumSizeHint() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "getMinimumSizeHint"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QSize"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); QSize returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("getMinimumSizeHint", methodInfo, result); } else { returnValue = *((QSize*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWidget::minimumSizeHint(); } void PythonQtShell_QWidget::mouseDoubleClickEvent(QMouseEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mouseDoubleClickEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QMouseEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidget::mouseDoubleClickEvent(arg__1); } void PythonQtShell_QWidget::mouseMoveEvent(QMouseEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mouseMoveEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QMouseEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidget::mouseMoveEvent(arg__1); } void PythonQtShell_QWidget::mousePressEvent(QMouseEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mousePressEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QMouseEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidget::mousePressEvent(arg__1); } void PythonQtShell_QWidget::mouseReleaseEvent(QMouseEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mouseReleaseEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QMouseEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidget::mouseReleaseEvent(arg__1); } void PythonQtShell_QWidget::moveEvent(QMoveEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "moveEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QMoveEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidget::moveEvent(arg__1); } QPaintEngine* PythonQtShell_QWidget::paintEngine() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "paintEngine"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QPaintEngine*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); QPaintEngine* returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("paintEngine", methodInfo, result); } else { returnValue = *((QPaintEngine**)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWidget::paintEngine(); } void PythonQtShell_QWidget::paintEvent(QPaintEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "paintEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QPaintEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidget::paintEvent(arg__1); } void PythonQtShell_QWidget::paletteChange(const QPalette& arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "paletteChange"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "const QPalette&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidget::paletteChange(arg__1); } void PythonQtShell_QWidget::resizeEvent(QResizeEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "resizeEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QResizeEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidget::resizeEvent(arg__1); } void PythonQtShell_QWidget::setVisible(bool visible) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "setVisible"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "bool"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&visible}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidget::setVisible(visible); } void PythonQtShell_QWidget::showEvent(QShowEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "showEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QShowEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidget::showEvent(arg__1); } QSize PythonQtShell_QWidget::sizeHint() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "getSizeHint"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QSize"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); QSize returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("getSizeHint", methodInfo, result); } else { returnValue = *((QSize*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWidget::sizeHint(); } void PythonQtShell_QWidget::tabletEvent(QTabletEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "tabletEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QTabletEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidget::tabletEvent(arg__1); } void PythonQtShell_QWidget::timerEvent(QTimerEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "timerEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QTimerEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidget::timerEvent(arg__1); } void PythonQtShell_QWidget::wheelEvent(QWheelEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "wheelEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QWheelEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidget::wheelEvent(arg__1); } void PythonQtShell_QWidget::windowActivationChange(bool arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "windowActivationChange"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "bool"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidget::windowActivationChange(arg__1); } QWidget* PythonQtWrapper_QWidget::new_QWidget(QWidget* parent, Qt::WindowFlags f) { return new PythonQtShell_QWidget(parent, f); } bool PythonQtWrapper_QWidget::acceptDrops(QWidget* theWrappedObject) const { return ( theWrappedObject->acceptDrops()); } QString PythonQtWrapper_QWidget::accessibleDescription(QWidget* theWrappedObject) const { return ( theWrappedObject->accessibleDescription()); } QString PythonQtWrapper_QWidget::accessibleName(QWidget* theWrappedObject) const { return ( theWrappedObject->accessibleName()); } void PythonQtWrapper_QWidget::actionEvent(QWidget* theWrappedObject, QActionEvent* arg__1) { ( ((PythonQtPublicPromoter_QWidget*)theWrappedObject)->promoted_actionEvent(arg__1)); } QList<QAction* > PythonQtWrapper_QWidget::actions(QWidget* theWrappedObject) const { return ( theWrappedObject->actions()); } void PythonQtWrapper_QWidget::activateWindow(QWidget* theWrappedObject) { ( theWrappedObject->activateWindow()); } void PythonQtWrapper_QWidget::addAction(QWidget* theWrappedObject, QAction* action) { ( theWrappedObject->addAction(action)); } void PythonQtWrapper_QWidget::addActions(QWidget* theWrappedObject, QList<QAction* > actions) { ( theWrappedObject->addActions(actions)); } void PythonQtWrapper_QWidget::adjustSize(QWidget* theWrappedObject) { ( theWrappedObject->adjustSize()); } bool PythonQtWrapper_QWidget::autoFillBackground(QWidget* theWrappedObject) const { return ( theWrappedObject->autoFillBackground()); } QPalette::ColorRole PythonQtWrapper_QWidget::backgroundRole(QWidget* theWrappedObject) const { return ( theWrappedObject->backgroundRole()); } QSize PythonQtWrapper_QWidget::baseSize(QWidget* theWrappedObject) const { return ( theWrappedObject->baseSize()); } void PythonQtWrapper_QWidget::changeEvent(QWidget* theWrappedObject, QEvent* arg__1) { ( ((PythonQtPublicPromoter_QWidget*)theWrappedObject)->promoted_changeEvent(arg__1)); } QWidget* PythonQtWrapper_QWidget::childAt(QWidget* theWrappedObject, const QPoint& p) const { return ( theWrappedObject->childAt(p)); } QWidget* PythonQtWrapper_QWidget::childAt(QWidget* theWrappedObject, int x, int y) const { return ( theWrappedObject->childAt(x, y)); } QRect PythonQtWrapper_QWidget::childrenRect(QWidget* theWrappedObject) const { return ( theWrappedObject->childrenRect()); } QRegion PythonQtWrapper_QWidget::childrenRegion(QWidget* theWrappedObject) const { return ( theWrappedObject->childrenRegion()); } void PythonQtWrapper_QWidget::clearFocus(QWidget* theWrappedObject) { ( theWrappedObject->clearFocus()); } void PythonQtWrapper_QWidget::clearMask(QWidget* theWrappedObject) { ( theWrappedObject->clearMask()); } void PythonQtWrapper_QWidget::closeEvent(QWidget* theWrappedObject, QCloseEvent* arg__1) { ( ((PythonQtPublicPromoter_QWidget*)theWrappedObject)->promoted_closeEvent(arg__1)); } QMargins PythonQtWrapper_QWidget::contentsMargins(QWidget* theWrappedObject) const { return ( theWrappedObject->contentsMargins()); } QRect PythonQtWrapper_QWidget::contentsRect(QWidget* theWrappedObject) const { return ( theWrappedObject->contentsRect()); } void PythonQtWrapper_QWidget::contextMenuEvent(QWidget* theWrappedObject, QContextMenuEvent* arg__1) { ( ((PythonQtPublicPromoter_QWidget*)theWrappedObject)->promoted_contextMenuEvent(arg__1)); } Qt::ContextMenuPolicy PythonQtWrapper_QWidget::contextMenuPolicy(QWidget* theWrappedObject) const { return ( theWrappedObject->contextMenuPolicy()); } void PythonQtWrapper_QWidget::createWinId(QWidget* theWrappedObject) { ( theWrappedObject->createWinId()); } QCursor PythonQtWrapper_QWidget::cursor(QWidget* theWrappedObject) const { return ( theWrappedObject->cursor()); } int PythonQtWrapper_QWidget::devType(QWidget* theWrappedObject) const { return ( ((PythonQtPublicPromoter_QWidget*)theWrappedObject)->promoted_devType()); } void PythonQtWrapper_QWidget::dragEnterEvent(QWidget* theWrappedObject, QDragEnterEvent* arg__1) { ( ((PythonQtPublicPromoter_QWidget*)theWrappedObject)->promoted_dragEnterEvent(arg__1)); } void PythonQtWrapper_QWidget::dragLeaveEvent(QWidget* theWrappedObject, QDragLeaveEvent* arg__1) { ( ((PythonQtPublicPromoter_QWidget*)theWrappedObject)->promoted_dragLeaveEvent(arg__1)); } void PythonQtWrapper_QWidget::dragMoveEvent(QWidget* theWrappedObject, QDragMoveEvent* arg__1) { ( ((PythonQtPublicPromoter_QWidget*)theWrappedObject)->promoted_dragMoveEvent(arg__1)); } void PythonQtWrapper_QWidget::dropEvent(QWidget* theWrappedObject, QDropEvent* arg__1) { ( ((PythonQtPublicPromoter_QWidget*)theWrappedObject)->promoted_dropEvent(arg__1)); } WId PythonQtWrapper_QWidget::effectiveWinId(QWidget* theWrappedObject) const { return ( theWrappedObject->effectiveWinId()); } void PythonQtWrapper_QWidget::ensurePolished(QWidget* theWrappedObject) const { ( theWrappedObject->ensurePolished()); } void PythonQtWrapper_QWidget::enterEvent(QWidget* theWrappedObject, QEvent* arg__1) { ( ((PythonQtPublicPromoter_QWidget*)theWrappedObject)->promoted_enterEvent(arg__1)); } bool PythonQtWrapper_QWidget::event(QWidget* theWrappedObject, QEvent* arg__1) { return ( ((PythonQtPublicPromoter_QWidget*)theWrappedObject)->promoted_event(arg__1)); } void PythonQtWrapper_QWidget::focusInEvent(QWidget* theWrappedObject, QFocusEvent* arg__1) { ( ((PythonQtPublicPromoter_QWidget*)theWrappedObject)->promoted_focusInEvent(arg__1)); } bool PythonQtWrapper_QWidget::focusNextPrevChild(QWidget* theWrappedObject, bool next) { return ( ((PythonQtPublicPromoter_QWidget*)theWrappedObject)->promoted_focusNextPrevChild(next)); } void PythonQtWrapper_QWidget::focusOutEvent(QWidget* theWrappedObject, QFocusEvent* arg__1) { ( ((PythonQtPublicPromoter_QWidget*)theWrappedObject)->promoted_focusOutEvent(arg__1)); } Qt::FocusPolicy PythonQtWrapper_QWidget::focusPolicy(QWidget* theWrappedObject) const { return ( theWrappedObject->focusPolicy()); } QWidget* PythonQtWrapper_QWidget::focusProxy(QWidget* theWrappedObject) const { return ( theWrappedObject->focusProxy()); } QWidget* PythonQtWrapper_QWidget::focusWidget(QWidget* theWrappedObject) const { return ( theWrappedObject->focusWidget()); } const QFont* PythonQtWrapper_QWidget::font(QWidget* theWrappedObject) const { return &( theWrappedObject->font()); } QPalette::ColorRole PythonQtWrapper_QWidget::foregroundRole(QWidget* theWrappedObject) const { return ( theWrappedObject->foregroundRole()); } QRect PythonQtWrapper_QWidget::frameGeometry(QWidget* theWrappedObject) const { return ( theWrappedObject->frameGeometry()); } QSize PythonQtWrapper_QWidget::frameSize(QWidget* theWrappedObject) const { return ( theWrappedObject->frameSize()); } const QRect* PythonQtWrapper_QWidget::geometry(QWidget* theWrappedObject) const { return &( theWrappedObject->geometry()); } void PythonQtWrapper_QWidget::getContentsMargins(QWidget* theWrappedObject, int* left, int* top, int* right, int* bottom) const { ( theWrappedObject->getContentsMargins(left, top, right, bottom)); } void PythonQtWrapper_QWidget::grabKeyboard(QWidget* theWrappedObject) { ( theWrappedObject->grabKeyboard()); } void PythonQtWrapper_QWidget::grabMouse(QWidget* theWrappedObject) { ( theWrappedObject->grabMouse()); } void PythonQtWrapper_QWidget::grabMouse(QWidget* theWrappedObject, const QCursor& arg__1) { ( theWrappedObject->grabMouse(arg__1)); } int PythonQtWrapper_QWidget::grabShortcut(QWidget* theWrappedObject, const QKeySequence& key, Qt::ShortcutContext context) { return ( theWrappedObject->grabShortcut(key, context)); } QGraphicsEffect* PythonQtWrapper_QWidget::graphicsEffect(QWidget* theWrappedObject) const { return ( theWrappedObject->graphicsEffect()); } QGraphicsProxyWidget* PythonQtWrapper_QWidget::graphicsProxyWidget(QWidget* theWrappedObject) const { return ( theWrappedObject->graphicsProxyWidget()); } bool PythonQtWrapper_QWidget::hasFocus(QWidget* theWrappedObject) const { return ( theWrappedObject->hasFocus()); } bool PythonQtWrapper_QWidget::hasMouseTracking(QWidget* theWrappedObject) const { return ( theWrappedObject->hasMouseTracking()); } int PythonQtWrapper_QWidget::height(QWidget* theWrappedObject) const { return ( theWrappedObject->height()); } int PythonQtWrapper_QWidget::heightForWidth(QWidget* theWrappedObject, int arg__1) const { return ( ((PythonQtPublicPromoter_QWidget*)theWrappedObject)->promoted_heightForWidth(arg__1)); } void PythonQtWrapper_QWidget::hideEvent(QWidget* theWrappedObject, QHideEvent* arg__1) { ( ((PythonQtPublicPromoter_QWidget*)theWrappedObject)->promoted_hideEvent(arg__1)); } QInputContext* PythonQtWrapper_QWidget::inputContext(QWidget* theWrappedObject) { return ( theWrappedObject->inputContext()); } void PythonQtWrapper_QWidget::inputMethodEvent(QWidget* theWrappedObject, QInputMethodEvent* arg__1) { ( ((PythonQtPublicPromoter_QWidget*)theWrappedObject)->promoted_inputMethodEvent(arg__1)); } Qt::InputMethodHints PythonQtWrapper_QWidget::inputMethodHints(QWidget* theWrappedObject) const { return ( theWrappedObject->inputMethodHints()); } QVariant PythonQtWrapper_QWidget::inputMethodQuery(QWidget* theWrappedObject, Qt::InputMethodQuery arg__1) const { return ( ((PythonQtPublicPromoter_QWidget*)theWrappedObject)->promoted_inputMethodQuery(arg__1)); } void PythonQtWrapper_QWidget::insertAction(QWidget* theWrappedObject, QAction* before, QAction* action) { ( theWrappedObject->insertAction(before, action)); } void PythonQtWrapper_QWidget::insertActions(QWidget* theWrappedObject, QAction* before, QList<QAction* > actions) { ( theWrappedObject->insertActions(before, actions)); } bool PythonQtWrapper_QWidget::isActiveWindow(QWidget* theWrappedObject) const { return ( theWrappedObject->isActiveWindow()); } bool PythonQtWrapper_QWidget::isAncestorOf(QWidget* theWrappedObject, const QWidget* child) const { return ( theWrappedObject->isAncestorOf(child)); } bool PythonQtWrapper_QWidget::isEnabled(QWidget* theWrappedObject) const { return ( theWrappedObject->isEnabled()); } bool PythonQtWrapper_QWidget::isEnabledTo(QWidget* theWrappedObject, QWidget* arg__1) const { return ( theWrappedObject->isEnabledTo(arg__1)); } bool PythonQtWrapper_QWidget::isFullScreen(QWidget* theWrappedObject) const { return ( theWrappedObject->isFullScreen()); } bool PythonQtWrapper_QWidget::isHidden(QWidget* theWrappedObject) const { return ( theWrappedObject->isHidden()); } bool PythonQtWrapper_QWidget::isLeftToRight(QWidget* theWrappedObject) const { return ( theWrappedObject->isLeftToRight()); } bool PythonQtWrapper_QWidget::isMaximized(QWidget* theWrappedObject) const { return ( theWrappedObject->isMaximized()); } bool PythonQtWrapper_QWidget::isMinimized(QWidget* theWrappedObject) const { return ( theWrappedObject->isMinimized()); } bool PythonQtWrapper_QWidget::isModal(QWidget* theWrappedObject) const { return ( theWrappedObject->isModal()); } bool PythonQtWrapper_QWidget::isRightToLeft(QWidget* theWrappedObject) const { return ( theWrappedObject->isRightToLeft()); } bool PythonQtWrapper_QWidget::isVisible(QWidget* theWrappedObject) const { return ( theWrappedObject->isVisible()); } bool PythonQtWrapper_QWidget::isVisibleTo(QWidget* theWrappedObject, QWidget* arg__1) const { return ( theWrappedObject->isVisibleTo(arg__1)); } bool PythonQtWrapper_QWidget::isWindow(QWidget* theWrappedObject) const { return ( theWrappedObject->isWindow()); } bool PythonQtWrapper_QWidget::isWindowModified(QWidget* theWrappedObject) const { return ( theWrappedObject->isWindowModified()); } void PythonQtWrapper_QWidget::keyPressEvent(QWidget* theWrappedObject, QKeyEvent* arg__1) { ( ((PythonQtPublicPromoter_QWidget*)theWrappedObject)->promoted_keyPressEvent(arg__1)); } void PythonQtWrapper_QWidget::keyReleaseEvent(QWidget* theWrappedObject, QKeyEvent* arg__1) { ( ((PythonQtPublicPromoter_QWidget*)theWrappedObject)->promoted_keyReleaseEvent(arg__1)); } QWidget* PythonQtWrapper_QWidget::static_QWidget_keyboardGrabber() { return (QWidget::keyboardGrabber()); } void PythonQtWrapper_QWidget::languageChange(QWidget* theWrappedObject) { ( ((PythonQtPublicPromoter_QWidget*)theWrappedObject)->promoted_languageChange()); } QLayout* PythonQtWrapper_QWidget::layout(QWidget* theWrappedObject) const { return ( theWrappedObject->layout()); } Qt::LayoutDirection PythonQtWrapper_QWidget::layoutDirection(QWidget* theWrappedObject) const { return ( theWrappedObject->layoutDirection()); } void PythonQtWrapper_QWidget::leaveEvent(QWidget* theWrappedObject, QEvent* arg__1) { ( ((PythonQtPublicPromoter_QWidget*)theWrappedObject)->promoted_leaveEvent(arg__1)); } QLocale PythonQtWrapper_QWidget::locale(QWidget* theWrappedObject) const { return ( theWrappedObject->locale()); } QPoint PythonQtWrapper_QWidget::mapFrom(QWidget* theWrappedObject, QWidget* arg__1, const QPoint& arg__2) const { return ( theWrappedObject->mapFrom(arg__1, arg__2)); } QPoint PythonQtWrapper_QWidget::mapFromGlobal(QWidget* theWrappedObject, const QPoint& arg__1) const { return ( theWrappedObject->mapFromGlobal(arg__1)); } QPoint PythonQtWrapper_QWidget::mapFromParent(QWidget* theWrappedObject, const QPoint& arg__1) const { return ( theWrappedObject->mapFromParent(arg__1)); } QPoint PythonQtWrapper_QWidget::mapTo(QWidget* theWrappedObject, QWidget* arg__1, const QPoint& arg__2) const { return ( theWrappedObject->mapTo(arg__1, arg__2)); } QPoint PythonQtWrapper_QWidget::mapToGlobal(QWidget* theWrappedObject, const QPoint& arg__1) const { return ( theWrappedObject->mapToGlobal(arg__1)); } QPoint PythonQtWrapper_QWidget::mapToParent(QWidget* theWrappedObject, const QPoint& arg__1) const { return ( theWrappedObject->mapToParent(arg__1)); } QRegion PythonQtWrapper_QWidget::mask(QWidget* theWrappedObject) const { return ( theWrappedObject->mask()); } int PythonQtWrapper_QWidget::maximumHeight(QWidget* theWrappedObject) const { return ( theWrappedObject->maximumHeight()); } QSize PythonQtWrapper_QWidget::maximumSize(QWidget* theWrappedObject) const { return ( theWrappedObject->maximumSize()); } int PythonQtWrapper_QWidget::maximumWidth(QWidget* theWrappedObject) const { return ( theWrappedObject->maximumWidth()); } int PythonQtWrapper_QWidget::metric(QWidget* theWrappedObject, QPaintDevice::PaintDeviceMetric arg__1) const { return ( ((PythonQtPublicPromoter_QWidget*)theWrappedObject)->promoted_metric(arg__1)); } int PythonQtWrapper_QWidget::minimumHeight(QWidget* theWrappedObject) const { return ( theWrappedObject->minimumHeight()); } QSize PythonQtWrapper_QWidget::minimumSize(QWidget* theWrappedObject) const { return ( theWrappedObject->minimumSize()); } QSize PythonQtWrapper_QWidget::minimumSizeHint(QWidget* theWrappedObject) const { return ( ((PythonQtPublicPromoter_QWidget*)theWrappedObject)->promoted_minimumSizeHint()); } int PythonQtWrapper_QWidget::minimumWidth(QWidget* theWrappedObject) const { return ( theWrappedObject->minimumWidth()); } void PythonQtWrapper_QWidget::mouseDoubleClickEvent(QWidget* theWrappedObject, QMouseEvent* arg__1) { ( ((PythonQtPublicPromoter_QWidget*)theWrappedObject)->promoted_mouseDoubleClickEvent(arg__1)); } QWidget* PythonQtWrapper_QWidget::static_QWidget_mouseGrabber() { return (QWidget::mouseGrabber()); } void PythonQtWrapper_QWidget::mouseMoveEvent(QWidget* theWrappedObject, QMouseEvent* arg__1) { ( ((PythonQtPublicPromoter_QWidget*)theWrappedObject)->promoted_mouseMoveEvent(arg__1)); } void PythonQtWrapper_QWidget::mousePressEvent(QWidget* theWrappedObject, QMouseEvent* arg__1) { ( ((PythonQtPublicPromoter_QWidget*)theWrappedObject)->promoted_mousePressEvent(arg__1)); } void PythonQtWrapper_QWidget::mouseReleaseEvent(QWidget* theWrappedObject, QMouseEvent* arg__1) { ( ((PythonQtPublicPromoter_QWidget*)theWrappedObject)->promoted_mouseReleaseEvent(arg__1)); } void PythonQtWrapper_QWidget::move(QWidget* theWrappedObject, const QPoint& arg__1) { ( theWrappedObject->move(arg__1)); } void PythonQtWrapper_QWidget::move(QWidget* theWrappedObject, int x, int y) { ( theWrappedObject->move(x, y)); } void PythonQtWrapper_QWidget::moveEvent(QWidget* theWrappedObject, QMoveEvent* arg__1) { ( ((PythonQtPublicPromoter_QWidget*)theWrappedObject)->promoted_moveEvent(arg__1)); } QWidget* PythonQtWrapper_QWidget::nativeParentWidget(QWidget* theWrappedObject) const { return ( theWrappedObject->nativeParentWidget()); } QWidget* PythonQtWrapper_QWidget::nextInFocusChain(QWidget* theWrappedObject) const { return ( theWrappedObject->nextInFocusChain()); } QRect PythonQtWrapper_QWidget::normalGeometry(QWidget* theWrappedObject) const { return ( theWrappedObject->normalGeometry()); } void PythonQtWrapper_QWidget::overrideWindowFlags(QWidget* theWrappedObject, Qt::WindowFlags type) { ( theWrappedObject->overrideWindowFlags(type)); } void PythonQtWrapper_QWidget::overrideWindowState(QWidget* theWrappedObject, Qt::WindowStates state) { ( theWrappedObject->overrideWindowState(state)); } QPaintEngine* PythonQtWrapper_QWidget::paintEngine(QWidget* theWrappedObject) const { return ( ((PythonQtPublicPromoter_QWidget*)theWrappedObject)->promoted_paintEngine()); } void PythonQtWrapper_QWidget::paintEvent(QWidget* theWrappedObject, QPaintEvent* arg__1) { ( ((PythonQtPublicPromoter_QWidget*)theWrappedObject)->promoted_paintEvent(arg__1)); } const QPalette* PythonQtWrapper_QWidget::palette(QWidget* theWrappedObject) const { return &( theWrappedObject->palette()); } QWidget* PythonQtWrapper_QWidget::parentWidget(QWidget* theWrappedObject) const { return ( theWrappedObject->parentWidget()); } QPoint PythonQtWrapper_QWidget::pos(QWidget* theWrappedObject) const { return ( theWrappedObject->pos()); } QWidget* PythonQtWrapper_QWidget::previousInFocusChain(QWidget* theWrappedObject) const { return ( theWrappedObject->previousInFocusChain()); } QRect PythonQtWrapper_QWidget::rect(QWidget* theWrappedObject) const { return ( theWrappedObject->rect()); } void PythonQtWrapper_QWidget::releaseKeyboard(QWidget* theWrappedObject) { ( theWrappedObject->releaseKeyboard()); } void PythonQtWrapper_QWidget::releaseMouse(QWidget* theWrappedObject) { ( theWrappedObject->releaseMouse()); } void PythonQtWrapper_QWidget::releaseShortcut(QWidget* theWrappedObject, int id) { ( theWrappedObject->releaseShortcut(id)); } void PythonQtWrapper_QWidget::removeAction(QWidget* theWrappedObject, QAction* action) { ( theWrappedObject->removeAction(action)); } void PythonQtWrapper_QWidget::render(QWidget* theWrappedObject, QPaintDevice* target, const QPoint& targetOffset, const QRegion& sourceRegion, QWidget::RenderFlags renderFlags) { ( theWrappedObject->render(target, targetOffset, sourceRegion, renderFlags)); } void PythonQtWrapper_QWidget::render(QWidget* theWrappedObject, QPainter* painter, const QPoint& targetOffset, const QRegion& sourceRegion, QWidget::RenderFlags renderFlags) { ( theWrappedObject->render(painter, targetOffset, sourceRegion, renderFlags)); } void PythonQtWrapper_QWidget::repaint(QWidget* theWrappedObject, const QRect& arg__1) { ( theWrappedObject->repaint(arg__1)); } void PythonQtWrapper_QWidget::repaint(QWidget* theWrappedObject, const QRegion& arg__1) { ( theWrappedObject->repaint(arg__1)); } void PythonQtWrapper_QWidget::repaint(QWidget* theWrappedObject, int x, int y, int w, int h) { ( theWrappedObject->repaint(x, y, w, h)); } void PythonQtWrapper_QWidget::resize(QWidget* theWrappedObject, const QSize& arg__1) { ( theWrappedObject->resize(arg__1)); } void PythonQtWrapper_QWidget::resize(QWidget* theWrappedObject, int w, int h) { ( theWrappedObject->resize(w, h)); } void PythonQtWrapper_QWidget::resizeEvent(QWidget* theWrappedObject, QResizeEvent* arg__1) { ( ((PythonQtPublicPromoter_QWidget*)theWrappedObject)->promoted_resizeEvent(arg__1)); } bool PythonQtWrapper_QWidget::restoreGeometry(QWidget* theWrappedObject, const QByteArray& geometry) { return ( theWrappedObject->restoreGeometry(geometry)); } QByteArray PythonQtWrapper_QWidget::saveGeometry(QWidget* theWrappedObject) const { return ( theWrappedObject->saveGeometry()); } void PythonQtWrapper_QWidget::scroll(QWidget* theWrappedObject, int dx, int dy) { ( theWrappedObject->scroll(dx, dy)); } void PythonQtWrapper_QWidget::scroll(QWidget* theWrappedObject, int dx, int dy, const QRect& arg__3) { ( theWrappedObject->scroll(dx, dy, arg__3)); } void PythonQtWrapper_QWidget::setAcceptDrops(QWidget* theWrappedObject, bool on) { ( theWrappedObject->setAcceptDrops(on)); } void PythonQtWrapper_QWidget::setAccessibleDescription(QWidget* theWrappedObject, const QString& description) { ( theWrappedObject->setAccessibleDescription(description)); } void PythonQtWrapper_QWidget::setAccessibleName(QWidget* theWrappedObject, const QString& name) { ( theWrappedObject->setAccessibleName(name)); } void PythonQtWrapper_QWidget::setAttribute(QWidget* theWrappedObject, Qt::WidgetAttribute arg__1, bool on) { ( theWrappedObject->setAttribute(arg__1, on)); } void PythonQtWrapper_QWidget::setAutoFillBackground(QWidget* theWrappedObject, bool enabled) { ( theWrappedObject->setAutoFillBackground(enabled)); } void PythonQtWrapper_QWidget::setBackgroundRole(QWidget* theWrappedObject, QPalette::ColorRole arg__1) { ( theWrappedObject->setBackgroundRole(arg__1)); } void PythonQtWrapper_QWidget::setBaseSize(QWidget* theWrappedObject, const QSize& arg__1) { ( theWrappedObject->setBaseSize(arg__1)); } void PythonQtWrapper_QWidget::setBaseSize(QWidget* theWrappedObject, int basew, int baseh) { ( theWrappedObject->setBaseSize(basew, baseh)); } void PythonQtWrapper_QWidget::setContentsMargins(QWidget* theWrappedObject, const QMargins& margins) { ( theWrappedObject->setContentsMargins(margins)); } void PythonQtWrapper_QWidget::setContentsMargins(QWidget* theWrappedObject, int left, int top, int right, int bottom) { ( theWrappedObject->setContentsMargins(left, top, right, bottom)); } void PythonQtWrapper_QWidget::setContextMenuPolicy(QWidget* theWrappedObject, Qt::ContextMenuPolicy policy) { ( theWrappedObject->setContextMenuPolicy(policy)); } void PythonQtWrapper_QWidget::setCursor(QWidget* theWrappedObject, const QCursor& arg__1) { ( theWrappedObject->setCursor(arg__1)); } void PythonQtWrapper_QWidget::setFixedHeight(QWidget* theWrappedObject, int h) { ( theWrappedObject->setFixedHeight(h)); } void PythonQtWrapper_QWidget::setFixedSize(QWidget* theWrappedObject, const QSize& arg__1) { ( theWrappedObject->setFixedSize(arg__1)); } void PythonQtWrapper_QWidget::setFixedSize(QWidget* theWrappedObject, int w, int h) { ( theWrappedObject->setFixedSize(w, h)); } void PythonQtWrapper_QWidget::setFixedWidth(QWidget* theWrappedObject, int w) { ( theWrappedObject->setFixedWidth(w)); } void PythonQtWrapper_QWidget::setFocus(QWidget* theWrappedObject, Qt::FocusReason reason) { ( theWrappedObject->setFocus(reason)); } void PythonQtWrapper_QWidget::setFocusPolicy(QWidget* theWrappedObject, Qt::FocusPolicy policy) { ( theWrappedObject->setFocusPolicy(policy)); } void PythonQtWrapper_QWidget::setFocusProxy(QWidget* theWrappedObject, QWidget* arg__1) { ( theWrappedObject->setFocusProxy(arg__1)); } void PythonQtWrapper_QWidget::setFont(QWidget* theWrappedObject, const QFont& arg__1) { ( theWrappedObject->setFont(arg__1)); } void PythonQtWrapper_QWidget::setForegroundRole(QWidget* theWrappedObject, QPalette::ColorRole arg__1) { ( theWrappedObject->setForegroundRole(arg__1)); } void PythonQtWrapper_QWidget::setGeometry(QWidget* theWrappedObject, const QRect& arg__1) { ( theWrappedObject->setGeometry(arg__1)); } void PythonQtWrapper_QWidget::setGeometry(QWidget* theWrappedObject, int x, int y, int w, int h) { ( theWrappedObject->setGeometry(x, y, w, h)); } void PythonQtWrapper_QWidget::setGraphicsEffect(QWidget* theWrappedObject, QGraphicsEffect* effect) { ( theWrappedObject->setGraphicsEffect(effect)); } void PythonQtWrapper_QWidget::setInputContext(QWidget* theWrappedObject, QInputContext* arg__1) { ( theWrappedObject->setInputContext(arg__1)); } void PythonQtWrapper_QWidget::setInputMethodHints(QWidget* theWrappedObject, Qt::InputMethodHints hints) { ( theWrappedObject->setInputMethodHints(hints)); } void PythonQtWrapper_QWidget::setLayout(QWidget* theWrappedObject, QLayout* arg__1) { ( theWrappedObject->setLayout(arg__1)); } void PythonQtWrapper_QWidget::setLayoutDirection(QWidget* theWrappedObject, Qt::LayoutDirection direction) { ( theWrappedObject->setLayoutDirection(direction)); } void PythonQtWrapper_QWidget::setLocale(QWidget* theWrappedObject, const QLocale& locale) { ( theWrappedObject->setLocale(locale)); } void PythonQtWrapper_QWidget::setMask(QWidget* theWrappedObject, const QBitmap& arg__1) { ( theWrappedObject->setMask(arg__1)); } void PythonQtWrapper_QWidget::setMask(QWidget* theWrappedObject, const QRegion& arg__1) { ( theWrappedObject->setMask(arg__1)); } void PythonQtWrapper_QWidget::setMaximumHeight(QWidget* theWrappedObject, int maxh) { ( theWrappedObject->setMaximumHeight(maxh)); } void PythonQtWrapper_QWidget::setMaximumSize(QWidget* theWrappedObject, const QSize& arg__1) { ( theWrappedObject->setMaximumSize(arg__1)); } void PythonQtWrapper_QWidget::setMaximumSize(QWidget* theWrappedObject, int maxw, int maxh) { ( theWrappedObject->setMaximumSize(maxw, maxh)); } void PythonQtWrapper_QWidget::setMaximumWidth(QWidget* theWrappedObject, int maxw) { ( theWrappedObject->setMaximumWidth(maxw)); } void PythonQtWrapper_QWidget::setMinimumHeight(QWidget* theWrappedObject, int minh) { ( theWrappedObject->setMinimumHeight(minh)); } void PythonQtWrapper_QWidget::setMinimumSize(QWidget* theWrappedObject, const QSize& arg__1) { ( theWrappedObject->setMinimumSize(arg__1)); } void PythonQtWrapper_QWidget::setMinimumSize(QWidget* theWrappedObject, int minw, int minh) { ( theWrappedObject->setMinimumSize(minw, minh)); } void PythonQtWrapper_QWidget::setMinimumWidth(QWidget* theWrappedObject, int minw) { ( theWrappedObject->setMinimumWidth(minw)); } void PythonQtWrapper_QWidget::setMouseTracking(QWidget* theWrappedObject, bool enable) { ( theWrappedObject->setMouseTracking(enable)); } void PythonQtWrapper_QWidget::setPalette(QWidget* theWrappedObject, const QPalette& arg__1) { ( theWrappedObject->setPalette(arg__1)); } void PythonQtWrapper_QWidget::setParent(QWidget* theWrappedObject, QWidget* parent) { ( theWrappedObject->setParent(parent)); } void PythonQtWrapper_QWidget::setParent(QWidget* theWrappedObject, QWidget* parent, Qt::WindowFlags f) { ( theWrappedObject->setParent(parent, f)); } void PythonQtWrapper_QWidget::setShortcutAutoRepeat(QWidget* theWrappedObject, int id, bool enable) { ( theWrappedObject->setShortcutAutoRepeat(id, enable)); } void PythonQtWrapper_QWidget::setShortcutEnabled(QWidget* theWrappedObject, int id, bool enable) { ( theWrappedObject->setShortcutEnabled(id, enable)); } void PythonQtWrapper_QWidget::setSizeIncrement(QWidget* theWrappedObject, const QSize& arg__1) { ( theWrappedObject->setSizeIncrement(arg__1)); } void PythonQtWrapper_QWidget::setSizeIncrement(QWidget* theWrappedObject, int w, int h) { ( theWrappedObject->setSizeIncrement(w, h)); } void PythonQtWrapper_QWidget::setSizePolicy(QWidget* theWrappedObject, QSizePolicy arg__1) { ( theWrappedObject->setSizePolicy(arg__1)); } void PythonQtWrapper_QWidget::setSizePolicy(QWidget* theWrappedObject, QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical) { ( theWrappedObject->setSizePolicy(horizontal, vertical)); } void PythonQtWrapper_QWidget::setStatusTip(QWidget* theWrappedObject, const QString& arg__1) { ( theWrappedObject->setStatusTip(arg__1)); } void PythonQtWrapper_QWidget::setStyle(QWidget* theWrappedObject, QStyle* arg__1) { ( theWrappedObject->setStyle(arg__1)); } void PythonQtWrapper_QWidget::static_QWidget_setTabOrder(QWidget* arg__1, QWidget* arg__2) { (QWidget::setTabOrder(arg__1, arg__2)); } void PythonQtWrapper_QWidget::setToolTip(QWidget* theWrappedObject, const QString& arg__1) { ( theWrappedObject->setToolTip(arg__1)); } void PythonQtWrapper_QWidget::setUpdatesEnabled(QWidget* theWrappedObject, bool enable) { ( theWrappedObject->setUpdatesEnabled(enable)); } void PythonQtWrapper_QWidget::setWhatsThis(QWidget* theWrappedObject, const QString& arg__1) { ( theWrappedObject->setWhatsThis(arg__1)); } void PythonQtWrapper_QWidget::setWindowFilePath(QWidget* theWrappedObject, const QString& filePath) { ( theWrappedObject->setWindowFilePath(filePath)); } void PythonQtWrapper_QWidget::setWindowFlags(QWidget* theWrappedObject, Qt::WindowFlags type) { ( theWrappedObject->setWindowFlags(type)); } void PythonQtWrapper_QWidget::setWindowIcon(QWidget* theWrappedObject, const QIcon& icon) { ( theWrappedObject->setWindowIcon(icon)); } void PythonQtWrapper_QWidget::setWindowIconText(QWidget* theWrappedObject, const QString& arg__1) { ( theWrappedObject->setWindowIconText(arg__1)); } void PythonQtWrapper_QWidget::setWindowModality(QWidget* theWrappedObject, Qt::WindowModality windowModality) { ( theWrappedObject->setWindowModality(windowModality)); } void PythonQtWrapper_QWidget::setWindowOpacity(QWidget* theWrappedObject, qreal level) { ( theWrappedObject->setWindowOpacity(level)); } void PythonQtWrapper_QWidget::setWindowRole(QWidget* theWrappedObject, const QString& arg__1) { ( theWrappedObject->setWindowRole(arg__1)); } void PythonQtWrapper_QWidget::setWindowState(QWidget* theWrappedObject, Qt::WindowStates state) { ( theWrappedObject->setWindowState(state)); } void PythonQtWrapper_QWidget::showEvent(QWidget* theWrappedObject, QShowEvent* arg__1) { ( ((PythonQtPublicPromoter_QWidget*)theWrappedObject)->promoted_showEvent(arg__1)); } QSize PythonQtWrapper_QWidget::size(QWidget* theWrappedObject) const { return ( theWrappedObject->size()); } QSize PythonQtWrapper_QWidget::sizeHint(QWidget* theWrappedObject) const { return ( ((PythonQtPublicPromoter_QWidget*)theWrappedObject)->promoted_sizeHint()); } QSize PythonQtWrapper_QWidget::sizeIncrement(QWidget* theWrappedObject) const { return ( theWrappedObject->sizeIncrement()); } QSizePolicy PythonQtWrapper_QWidget::sizePolicy(QWidget* theWrappedObject) const { return ( theWrappedObject->sizePolicy()); } void PythonQtWrapper_QWidget::stackUnder(QWidget* theWrappedObject, QWidget* arg__1) { ( theWrappedObject->stackUnder(arg__1)); } QString PythonQtWrapper_QWidget::statusTip(QWidget* theWrappedObject) const { return ( theWrappedObject->statusTip()); } QStyle* PythonQtWrapper_QWidget::style(QWidget* theWrappedObject) const { return ( theWrappedObject->style()); } QString PythonQtWrapper_QWidget::styleSheet(QWidget* theWrappedObject) const { return ( theWrappedObject->styleSheet()); } void PythonQtWrapper_QWidget::tabletEvent(QWidget* theWrappedObject, QTabletEvent* arg__1) { ( ((PythonQtPublicPromoter_QWidget*)theWrappedObject)->promoted_tabletEvent(arg__1)); } bool PythonQtWrapper_QWidget::testAttribute(QWidget* theWrappedObject, Qt::WidgetAttribute arg__1) const { return ( theWrappedObject->testAttribute(arg__1)); } QString PythonQtWrapper_QWidget::toolTip(QWidget* theWrappedObject) const { return ( theWrappedObject->toolTip()); } bool PythonQtWrapper_QWidget::underMouse(QWidget* theWrappedObject) const { return ( theWrappedObject->underMouse()); } void PythonQtWrapper_QWidget::unsetCursor(QWidget* theWrappedObject) { ( theWrappedObject->unsetCursor()); } void PythonQtWrapper_QWidget::unsetLayoutDirection(QWidget* theWrappedObject) { ( theWrappedObject->unsetLayoutDirection()); } void PythonQtWrapper_QWidget::unsetLocale(QWidget* theWrappedObject) { ( theWrappedObject->unsetLocale()); } void PythonQtWrapper_QWidget::update(QWidget* theWrappedObject, const QRect& arg__1) { ( theWrappedObject->update(arg__1)); } void PythonQtWrapper_QWidget::update(QWidget* theWrappedObject, const QRegion& arg__1) { ( theWrappedObject->update(arg__1)); } void PythonQtWrapper_QWidget::update(QWidget* theWrappedObject, int x, int y, int w, int h) { ( theWrappedObject->update(x, y, w, h)); } void PythonQtWrapper_QWidget::updateGeometry(QWidget* theWrappedObject) { ( theWrappedObject->updateGeometry()); } bool PythonQtWrapper_QWidget::updatesEnabled(QWidget* theWrappedObject) const { return ( theWrappedObject->updatesEnabled()); } QRegion PythonQtWrapper_QWidget::visibleRegion(QWidget* theWrappedObject) const { return ( theWrappedObject->visibleRegion()); } QString PythonQtWrapper_QWidget::whatsThis(QWidget* theWrappedObject) const { return ( theWrappedObject->whatsThis()); } void PythonQtWrapper_QWidget::wheelEvent(QWidget* theWrappedObject, QWheelEvent* arg__1) { ( ((PythonQtPublicPromoter_QWidget*)theWrappedObject)->promoted_wheelEvent(arg__1)); } int PythonQtWrapper_QWidget::width(QWidget* theWrappedObject) const { return ( theWrappedObject->width()); } WId PythonQtWrapper_QWidget::winId(QWidget* theWrappedObject) const { return ( theWrappedObject->winId()); } QWidget* PythonQtWrapper_QWidget::window(QWidget* theWrappedObject) const { return ( theWrappedObject->window()); } QString PythonQtWrapper_QWidget::windowFilePath(QWidget* theWrappedObject) const { return ( theWrappedObject->windowFilePath()); } Qt::WindowFlags PythonQtWrapper_QWidget::windowFlags(QWidget* theWrappedObject) const { return ( theWrappedObject->windowFlags()); } QIcon PythonQtWrapper_QWidget::windowIcon(QWidget* theWrappedObject) const { return ( theWrappedObject->windowIcon()); } QString PythonQtWrapper_QWidget::windowIconText(QWidget* theWrappedObject) const { return ( theWrappedObject->windowIconText()); } Qt::WindowModality PythonQtWrapper_QWidget::windowModality(QWidget* theWrappedObject) const { return ( theWrappedObject->windowModality()); } qreal PythonQtWrapper_QWidget::windowOpacity(QWidget* theWrappedObject) const { return ( theWrappedObject->windowOpacity()); } QString PythonQtWrapper_QWidget::windowRole(QWidget* theWrappedObject) const { return ( theWrappedObject->windowRole()); } Qt::WindowStates PythonQtWrapper_QWidget::windowState(QWidget* theWrappedObject) const { return ( theWrappedObject->windowState()); } QString PythonQtWrapper_QWidget::windowTitle(QWidget* theWrappedObject) const { return ( theWrappedObject->windowTitle()); } Qt::WindowType PythonQtWrapper_QWidget::windowType(QWidget* theWrappedObject) const { return ( theWrappedObject->windowType()); } int PythonQtWrapper_QWidget::x(QWidget* theWrappedObject) const { return ( theWrappedObject->x()); } int PythonQtWrapper_QWidget::y(QWidget* theWrappedObject) const { return ( theWrappedObject->y()); } void PythonQtShell_QWidgetAction::childEvent(QChildEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "childEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QChildEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidgetAction::childEvent(arg__1); } QWidget* PythonQtShell_QWidgetAction::createWidget(QWidget* parent) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "createWidget"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QWidget*" , "QWidget*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); QWidget* returnValue; void* args[2] = {NULL, (void*)&parent}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("createWidget", methodInfo, result); } else { returnValue = *((QWidget**)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWidgetAction::createWidget(parent); } void PythonQtShell_QWidgetAction::customEvent(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "customEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidgetAction::customEvent(arg__1); } void PythonQtShell_QWidgetAction::deleteWidget(QWidget* widget) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "deleteWidget"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QWidget*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&widget}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidgetAction::deleteWidget(widget); } bool PythonQtShell_QWidgetAction::event(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "event"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); bool returnValue; void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("event", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWidgetAction::event(arg__1); } bool PythonQtShell_QWidgetAction::eventFilter(QObject* arg__1, QEvent* arg__2) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "eventFilter"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "QObject*" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); bool returnValue; void* args[3] = {NULL, (void*)&arg__1, (void*)&arg__2}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("eventFilter", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWidgetAction::eventFilter(arg__1, arg__2); } void PythonQtShell_QWidgetAction::timerEvent(QTimerEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "timerEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QTimerEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidgetAction::timerEvent(arg__1); } QWidgetAction* PythonQtWrapper_QWidgetAction::new_QWidgetAction(QObject* parent) { return new PythonQtShell_QWidgetAction(parent); } QWidget* PythonQtWrapper_QWidgetAction::createWidget(QWidgetAction* theWrappedObject, QWidget* parent) { return ( ((PythonQtPublicPromoter_QWidgetAction*)theWrappedObject)->promoted_createWidget(parent)); } QWidget* PythonQtWrapper_QWidgetAction::defaultWidget(QWidgetAction* theWrappedObject) const { return ( theWrappedObject->defaultWidget()); } void PythonQtWrapper_QWidgetAction::deleteWidget(QWidgetAction* theWrappedObject, QWidget* widget) { ( ((PythonQtPublicPromoter_QWidgetAction*)theWrappedObject)->promoted_deleteWidget(widget)); } bool PythonQtWrapper_QWidgetAction::event(QWidgetAction* theWrappedObject, QEvent* arg__1) { return ( ((PythonQtPublicPromoter_QWidgetAction*)theWrappedObject)->promoted_event(arg__1)); } bool PythonQtWrapper_QWidgetAction::eventFilter(QWidgetAction* theWrappedObject, QObject* arg__1, QEvent* arg__2) { return ( ((PythonQtPublicPromoter_QWidgetAction*)theWrappedObject)->promoted_eventFilter(arg__1, arg__2)); } void PythonQtWrapper_QWidgetAction::releaseWidget(QWidgetAction* theWrappedObject, QWidget* widget) { ( theWrappedObject->releaseWidget(widget)); } QWidget* PythonQtWrapper_QWidgetAction::requestWidget(QWidgetAction* theWrappedObject, QWidget* parent) { return ( theWrappedObject->requestWidget(parent)); } void PythonQtWrapper_QWidgetAction::setDefaultWidget(QWidgetAction* theWrappedObject, QWidget* w) { ( theWrappedObject->setDefaultWidget(w)); } Qt::Orientations PythonQtShell_QWidgetItem::expandingDirections() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "expandingDirections"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"Qt::Orientations"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); Qt::Orientations returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("expandingDirections", methodInfo, result); } else { returnValue = *((Qt::Orientations*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWidgetItem::expandingDirections(); } QRect PythonQtShell_QWidgetItem::geometry() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "geometry"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QRect"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); QRect returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("geometry", methodInfo, result); } else { returnValue = *((QRect*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWidgetItem::geometry(); } bool PythonQtShell_QWidgetItem::hasHeightForWidth() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "hasHeightForWidth"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); bool returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("hasHeightForWidth", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWidgetItem::hasHeightForWidth(); } int PythonQtShell_QWidgetItem::heightForWidth(int arg__1) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "heightForWidth"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); int returnValue; void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("heightForWidth", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWidgetItem::heightForWidth(arg__1); } void PythonQtShell_QWidgetItem::invalidate() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "invalidate"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={""}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidgetItem::invalidate(); } bool PythonQtShell_QWidgetItem::isEmpty() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "isEmpty"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); bool returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("isEmpty", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWidgetItem::isEmpty(); } QLayout* PythonQtShell_QWidgetItem::layout() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "layout"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QLayout*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); QLayout* returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("layout", methodInfo, result); } else { returnValue = *((QLayout**)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWidgetItem::layout(); } QSize PythonQtShell_QWidgetItem::maximumSize() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "maximumSize"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QSize"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); QSize returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("maximumSize", methodInfo, result); } else { returnValue = *((QSize*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWidgetItem::maximumSize(); } int PythonQtShell_QWidgetItem::minimumHeightForWidth(int arg__1) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "minimumHeightForWidth"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); int returnValue; void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("minimumHeightForWidth", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWidgetItem::minimumHeightForWidth(arg__1); } QSize PythonQtShell_QWidgetItem::minimumSize() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "minimumSize"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QSize"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); QSize returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("minimumSize", methodInfo, result); } else { returnValue = *((QSize*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWidgetItem::minimumSize(); } void PythonQtShell_QWidgetItem::setGeometry(const QRect& arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "setGeometry"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "const QRect&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWidgetItem::setGeometry(arg__1); } QSize PythonQtShell_QWidgetItem::sizeHint() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "sizeHint"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QSize"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); QSize returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("sizeHint", methodInfo, result); } else { returnValue = *((QSize*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWidgetItem::sizeHint(); } QSpacerItem* PythonQtShell_QWidgetItem::spacerItem() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "spacerItem"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QSpacerItem*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); QSpacerItem* returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("spacerItem", methodInfo, result); } else { returnValue = *((QSpacerItem**)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWidgetItem::spacerItem(); } QWidget* PythonQtShell_QWidgetItem::widget() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "widget"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QWidget*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); QWidget* returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("widget", methodInfo, result); } else { returnValue = *((QWidget**)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWidgetItem::widget(); } QWidgetItem* PythonQtWrapper_QWidgetItem::new_QWidgetItem(QWidget* w) { return new PythonQtShell_QWidgetItem(w); } Qt::Orientations PythonQtWrapper_QWidgetItem::expandingDirections(QWidgetItem* theWrappedObject) const { return ( ((PythonQtPublicPromoter_QWidgetItem*)theWrappedObject)->promoted_expandingDirections()); } QRect PythonQtWrapper_QWidgetItem::geometry(QWidgetItem* theWrappedObject) const { return ( ((PythonQtPublicPromoter_QWidgetItem*)theWrappedObject)->promoted_geometry()); } bool PythonQtWrapper_QWidgetItem::hasHeightForWidth(QWidgetItem* theWrappedObject) const { return ( ((PythonQtPublicPromoter_QWidgetItem*)theWrappedObject)->promoted_hasHeightForWidth()); } int PythonQtWrapper_QWidgetItem::heightForWidth(QWidgetItem* theWrappedObject, int arg__1) const { return ( ((PythonQtPublicPromoter_QWidgetItem*)theWrappedObject)->promoted_heightForWidth(arg__1)); } bool PythonQtWrapper_QWidgetItem::isEmpty(QWidgetItem* theWrappedObject) const { return ( ((PythonQtPublicPromoter_QWidgetItem*)theWrappedObject)->promoted_isEmpty()); } QSize PythonQtWrapper_QWidgetItem::maximumSize(QWidgetItem* theWrappedObject) const { return ( ((PythonQtPublicPromoter_QWidgetItem*)theWrappedObject)->promoted_maximumSize()); } QSize PythonQtWrapper_QWidgetItem::minimumSize(QWidgetItem* theWrappedObject) const { return ( ((PythonQtPublicPromoter_QWidgetItem*)theWrappedObject)->promoted_minimumSize()); } void PythonQtWrapper_QWidgetItem::setGeometry(QWidgetItem* theWrappedObject, const QRect& arg__1) { ( ((PythonQtPublicPromoter_QWidgetItem*)theWrappedObject)->promoted_setGeometry(arg__1)); } QSize PythonQtWrapper_QWidgetItem::sizeHint(QWidgetItem* theWrappedObject) const { return ( ((PythonQtPublicPromoter_QWidgetItem*)theWrappedObject)->promoted_sizeHint()); } QWidget* PythonQtWrapper_QWidgetItem::widget(QWidgetItem* theWrappedObject) { return ( ((PythonQtPublicPromoter_QWidgetItem*)theWrappedObject)->promoted_widget()); } QWindowStateChangeEvent* PythonQtWrapper_QWindowStateChangeEvent::new_QWindowStateChangeEvent(Qt::WindowStates aOldState) { return new QWindowStateChangeEvent(aOldState); } QWindowStateChangeEvent* PythonQtWrapper_QWindowStateChangeEvent::new_QWindowStateChangeEvent(Qt::WindowStates aOldState, bool isOverride) { return new QWindowStateChangeEvent(aOldState, isOverride); } bool PythonQtWrapper_QWindowStateChangeEvent::isOverride(QWindowStateChangeEvent* theWrappedObject) const { return ( theWrappedObject->isOverride()); } Qt::WindowStates PythonQtWrapper_QWindowStateChangeEvent::oldState(QWindowStateChangeEvent* theWrappedObject) const { return ( theWrappedObject->oldState()); } void PythonQtShell_QWindowsStyle::childEvent(QChildEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "childEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QChildEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWindowsStyle::childEvent(arg__1); } void PythonQtShell_QWindowsStyle::customEvent(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "customEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWindowsStyle::customEvent(arg__1); } void PythonQtShell_QWindowsStyle::drawComplexControl(QStyle::ComplexControl cc, const QStyleOptionComplex* opt, QPainter* p, const QWidget* w) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "drawComplexControl"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QStyle::ComplexControl" , "const QStyleOptionComplex*" , "QPainter*" , "const QWidget*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(5, argumentList); void* args[5] = {NULL, (void*)&cc, (void*)&opt, (void*)&p, (void*)&w}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWindowsStyle::drawComplexControl(cc, opt, p, w); } void PythonQtShell_QWindowsStyle::drawControl(QStyle::ControlElement element, const QStyleOption* opt, QPainter* p, const QWidget* w) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "drawControl"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QStyle::ControlElement" , "const QStyleOption*" , "QPainter*" , "const QWidget*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(5, argumentList); void* args[5] = {NULL, (void*)&element, (void*)&opt, (void*)&p, (void*)&w}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWindowsStyle::drawControl(element, opt, p, w); } void PythonQtShell_QWindowsStyle::drawItemPixmap(QPainter* painter, const QRect& rect, int alignment, const QPixmap& pixmap) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "drawItemPixmap"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QPainter*" , "const QRect&" , "int" , "const QPixmap&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(5, argumentList); void* args[5] = {NULL, (void*)&painter, (void*)&rect, (void*)&alignment, (void*)&pixmap}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWindowsStyle::drawItemPixmap(painter, rect, alignment, pixmap); } void PythonQtShell_QWindowsStyle::drawItemText(QPainter* painter, const QRect& rect, int flags, const QPalette& pal, bool enabled, const QString& text, QPalette::ColorRole textRole) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "drawItemText"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QPainter*" , "const QRect&" , "int" , "const QPalette&" , "bool" , "const QString&" , "QPalette::ColorRole"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(8, argumentList); void* args[8] = {NULL, (void*)&painter, (void*)&rect, (void*)&flags, (void*)&pal, (void*)&enabled, (void*)&text, (void*)&textRole}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWindowsStyle::drawItemText(painter, rect, flags, pal, enabled, text, textRole); } void PythonQtShell_QWindowsStyle::drawPrimitive(QStyle::PrimitiveElement pe, const QStyleOption* opt, QPainter* p, const QWidget* w) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "drawPrimitive"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QStyle::PrimitiveElement" , "const QStyleOption*" , "QPainter*" , "const QWidget*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(5, argumentList); void* args[5] = {NULL, (void*)&pe, (void*)&opt, (void*)&p, (void*)&w}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWindowsStyle::drawPrimitive(pe, opt, p, w); } bool PythonQtShell_QWindowsStyle::event(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "event"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); bool returnValue; void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("event", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWindowsStyle::event(arg__1); } bool PythonQtShell_QWindowsStyle::eventFilter(QObject* o, QEvent* e) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "eventFilter"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "QObject*" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); bool returnValue; void* args[3] = {NULL, (void*)&o, (void*)&e}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("eventFilter", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWindowsStyle::eventFilter(o, e); } QPixmap PythonQtShell_QWindowsStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap& pixmap, const QStyleOption* opt) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "generatedIconPixmap"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QPixmap" , "QIcon::Mode" , "const QPixmap&" , "const QStyleOption*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(4, argumentList); QPixmap returnValue; void* args[4] = {NULL, (void*)&iconMode, (void*)&pixmap, (void*)&opt}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("generatedIconPixmap", methodInfo, result); } else { returnValue = *((QPixmap*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWindowsStyle::generatedIconPixmap(iconMode, pixmap, opt); } QStyle::SubControl PythonQtShell_QWindowsStyle::hitTestComplexControl(QStyle::ComplexControl cc, const QStyleOptionComplex* opt, const QPoint& pt, const QWidget* w) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "hitTestComplexControl"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QStyle::SubControl" , "QStyle::ComplexControl" , "const QStyleOptionComplex*" , "const QPoint&" , "const QWidget*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(5, argumentList); QStyle::SubControl returnValue; void* args[5] = {NULL, (void*)&cc, (void*)&opt, (void*)&pt, (void*)&w}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("hitTestComplexControl", methodInfo, result); } else { returnValue = *((QStyle::SubControl*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWindowsStyle::hitTestComplexControl(cc, opt, pt, w); } QRect PythonQtShell_QWindowsStyle::itemPixmapRect(const QRect& r, int flags, const QPixmap& pixmap) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "itemPixmapRect"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QRect" , "const QRect&" , "int" , "const QPixmap&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(4, argumentList); QRect returnValue; void* args[4] = {NULL, (void*)&r, (void*)&flags, (void*)&pixmap}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("itemPixmapRect", methodInfo, result); } else { returnValue = *((QRect*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWindowsStyle::itemPixmapRect(r, flags, pixmap); } int PythonQtShell_QWindowsStyle::pixelMetric(QStyle::PixelMetric pm, const QStyleOption* option, const QWidget* widget) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "pixelMetric"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int" , "QStyle::PixelMetric" , "const QStyleOption*" , "const QWidget*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(4, argumentList); int returnValue; void* args[4] = {NULL, (void*)&pm, (void*)&option, (void*)&widget}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("pixelMetric", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWindowsStyle::pixelMetric(pm, option, widget); } void PythonQtShell_QWindowsStyle::polish(QApplication* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "polish"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QApplication*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWindowsStyle::polish(arg__1); } void PythonQtShell_QWindowsStyle::polish(QPalette& arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "polish"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QPalette&"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWindowsStyle::polish(arg__1); } void PythonQtShell_QWindowsStyle::polish(QWidget* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "polish"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QWidget*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWindowsStyle::polish(arg__1); } QSize PythonQtShell_QWindowsStyle::sizeFromContents(QStyle::ContentsType ct, const QStyleOption* opt, const QSize& contentsSize, const QWidget* widget) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "sizeFromContents"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QSize" , "QStyle::ContentsType" , "const QStyleOption*" , "const QSize&" , "const QWidget*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(5, argumentList); QSize returnValue; void* args[5] = {NULL, (void*)&ct, (void*)&opt, (void*)&contentsSize, (void*)&widget}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("sizeFromContents", methodInfo, result); } else { returnValue = *((QSize*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWindowsStyle::sizeFromContents(ct, opt, contentsSize, widget); } QPalette PythonQtShell_QWindowsStyle::standardPalette() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "standardPalette"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QPalette"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); QPalette returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("standardPalette", methodInfo, result); } else { returnValue = *((QPalette*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWindowsStyle::standardPalette(); } QPixmap PythonQtShell_QWindowsStyle::standardPixmap(QStyle::StandardPixmap standardPixmap, const QStyleOption* opt, const QWidget* widget) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "standardPixmap"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QPixmap" , "QStyle::StandardPixmap" , "const QStyleOption*" , "const QWidget*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(4, argumentList); QPixmap returnValue; void* args[4] = {NULL, (void*)&standardPixmap, (void*)&opt, (void*)&widget}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("standardPixmap", methodInfo, result); } else { returnValue = *((QPixmap*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QPixmap(); } int PythonQtShell_QWindowsStyle::styleHint(QStyle::StyleHint hint, const QStyleOption* opt, const QWidget* widget, QStyleHintReturn* returnData) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "styleHint"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int" , "QStyle::StyleHint" , "const QStyleOption*" , "const QWidget*" , "QStyleHintReturn*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(5, argumentList); int returnValue; void* args[5] = {NULL, (void*)&hint, (void*)&opt, (void*)&widget, (void*)&returnData}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("styleHint", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWindowsStyle::styleHint(hint, opt, widget, returnData); } QRect PythonQtShell_QWindowsStyle::subControlRect(QStyle::ComplexControl cc, const QStyleOptionComplex* opt, QStyle::SubControl sc, const QWidget* w) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "subControlRect"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QRect" , "QStyle::ComplexControl" , "const QStyleOptionComplex*" , "QStyle::SubControl" , "const QWidget*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(5, argumentList); QRect returnValue; void* args[5] = {NULL, (void*)&cc, (void*)&opt, (void*)&sc, (void*)&w}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("subControlRect", methodInfo, result); } else { returnValue = *((QRect*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWindowsStyle::subControlRect(cc, opt, sc, w); } QRect PythonQtShell_QWindowsStyle::subElementRect(QStyle::SubElement r, const QStyleOption* opt, const QWidget* widget) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "subElementRect"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QRect" , "QStyle::SubElement" , "const QStyleOption*" , "const QWidget*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(4, argumentList); QRect returnValue; void* args[4] = {NULL, (void*)&r, (void*)&opt, (void*)&widget}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("subElementRect", methodInfo, result); } else { returnValue = *((QRect*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWindowsStyle::subElementRect(r, opt, widget); } void PythonQtShell_QWindowsStyle::timerEvent(QTimerEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "timerEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QTimerEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWindowsStyle::timerEvent(event); } void PythonQtShell_QWindowsStyle::unpolish(QApplication* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "unpolish"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QApplication*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWindowsStyle::unpolish(arg__1); } void PythonQtShell_QWindowsStyle::unpolish(QWidget* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "unpolish"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QWidget*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWindowsStyle::unpolish(arg__1); } QWindowsStyle* PythonQtWrapper_QWindowsStyle::new_QWindowsStyle() { return new PythonQtShell_QWindowsStyle(); } void PythonQtWrapper_QWindowsStyle::drawComplexControl(QWindowsStyle* theWrappedObject, QStyle::ComplexControl cc, const QStyleOptionComplex* opt, QPainter* p, const QWidget* w) const { ( ((PythonQtPublicPromoter_QWindowsStyle*)theWrappedObject)->promoted_drawComplexControl(cc, opt, p, w)); } void PythonQtWrapper_QWindowsStyle::drawControl(QWindowsStyle* theWrappedObject, QStyle::ControlElement element, const QStyleOption* opt, QPainter* p, const QWidget* w) const { ( ((PythonQtPublicPromoter_QWindowsStyle*)theWrappedObject)->promoted_drawControl(element, opt, p, w)); } void PythonQtWrapper_QWindowsStyle::drawPrimitive(QWindowsStyle* theWrappedObject, QStyle::PrimitiveElement pe, const QStyleOption* opt, QPainter* p, const QWidget* w) const { ( ((PythonQtPublicPromoter_QWindowsStyle*)theWrappedObject)->promoted_drawPrimitive(pe, opt, p, w)); } bool PythonQtWrapper_QWindowsStyle::eventFilter(QWindowsStyle* theWrappedObject, QObject* o, QEvent* e) { return ( ((PythonQtPublicPromoter_QWindowsStyle*)theWrappedObject)->promoted_eventFilter(o, e)); } int PythonQtWrapper_QWindowsStyle::pixelMetric(QWindowsStyle* theWrappedObject, QStyle::PixelMetric pm, const QStyleOption* option, const QWidget* widget) const { return ( ((PythonQtPublicPromoter_QWindowsStyle*)theWrappedObject)->promoted_pixelMetric(pm, option, widget)); } void PythonQtWrapper_QWindowsStyle::polish(QWindowsStyle* theWrappedObject, QApplication* arg__1) { ( ((PythonQtPublicPromoter_QWindowsStyle*)theWrappedObject)->promoted_polish(arg__1)); } void PythonQtWrapper_QWindowsStyle::polish(QWindowsStyle* theWrappedObject, QPalette& arg__1) { ( ((PythonQtPublicPromoter_QWindowsStyle*)theWrappedObject)->promoted_polish(arg__1)); } void PythonQtWrapper_QWindowsStyle::polish(QWindowsStyle* theWrappedObject, QWidget* arg__1) { ( ((PythonQtPublicPromoter_QWindowsStyle*)theWrappedObject)->promoted_polish(arg__1)); } QSize PythonQtWrapper_QWindowsStyle::sizeFromContents(QWindowsStyle* theWrappedObject, QStyle::ContentsType ct, const QStyleOption* opt, const QSize& contentsSize, const QWidget* widget) const { return ( ((PythonQtPublicPromoter_QWindowsStyle*)theWrappedObject)->promoted_sizeFromContents(ct, opt, contentsSize, widget)); } int PythonQtWrapper_QWindowsStyle::styleHint(QWindowsStyle* theWrappedObject, QStyle::StyleHint hint, const QStyleOption* opt, const QWidget* widget, QStyleHintReturn* returnData) const { return ( ((PythonQtPublicPromoter_QWindowsStyle*)theWrappedObject)->promoted_styleHint(hint, opt, widget, returnData)); } QRect PythonQtWrapper_QWindowsStyle::subElementRect(QWindowsStyle* theWrappedObject, QStyle::SubElement r, const QStyleOption* opt, const QWidget* widget) const { return ( ((PythonQtPublicPromoter_QWindowsStyle*)theWrappedObject)->promoted_subElementRect(r, opt, widget)); } void PythonQtWrapper_QWindowsStyle::timerEvent(QWindowsStyle* theWrappedObject, QTimerEvent* event) { ( ((PythonQtPublicPromoter_QWindowsStyle*)theWrappedObject)->promoted_timerEvent(event)); } void PythonQtWrapper_QWindowsStyle::unpolish(QWindowsStyle* theWrappedObject, QApplication* arg__1) { ( ((PythonQtPublicPromoter_QWindowsStyle*)theWrappedObject)->promoted_unpolish(arg__1)); } void PythonQtWrapper_QWindowsStyle::unpolish(QWindowsStyle* theWrappedObject, QWidget* arg__1) { ( ((PythonQtPublicPromoter_QWindowsStyle*)theWrappedObject)->promoted_unpolish(arg__1)); } void PythonQtShell_QWizard::accept() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "accept"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={""}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizard::accept(); } void PythonQtShell_QWizard::actionEvent(QActionEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "actionEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QActionEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizard::actionEvent(arg__1); } void PythonQtShell_QWizard::changeEvent(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "changeEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizard::changeEvent(arg__1); } void PythonQtShell_QWizard::childEvent(QChildEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "childEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QChildEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizard::childEvent(arg__1); } void PythonQtShell_QWizard::cleanupPage(int id) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "cleanupPage"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&id}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizard::cleanupPage(id); } void PythonQtShell_QWizard::closeEvent(QCloseEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "closeEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QCloseEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizard::closeEvent(arg__1); } void PythonQtShell_QWizard::contextMenuEvent(QContextMenuEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "contextMenuEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QContextMenuEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizard::contextMenuEvent(arg__1); } void PythonQtShell_QWizard::customEvent(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "customEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizard::customEvent(arg__1); } int PythonQtShell_QWizard::devType() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "devType"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); int returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("devType", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWizard::devType(); } void PythonQtShell_QWizard::done(int result) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "done"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&result}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizard::done(result); } void PythonQtShell_QWizard::dragEnterEvent(QDragEnterEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dragEnterEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QDragEnterEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizard::dragEnterEvent(arg__1); } void PythonQtShell_QWizard::dragLeaveEvent(QDragLeaveEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dragLeaveEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QDragLeaveEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizard::dragLeaveEvent(arg__1); } void PythonQtShell_QWizard::dragMoveEvent(QDragMoveEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dragMoveEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QDragMoveEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizard::dragMoveEvent(arg__1); } void PythonQtShell_QWizard::dropEvent(QDropEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dropEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QDropEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizard::dropEvent(arg__1); } void PythonQtShell_QWizard::enterEvent(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "enterEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizard::enterEvent(arg__1); } bool PythonQtShell_QWizard::event(QEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "event"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); bool returnValue; void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("event", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWizard::event(event); } bool PythonQtShell_QWizard::eventFilter(QObject* arg__1, QEvent* arg__2) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "eventFilter"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "QObject*" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); bool returnValue; void* args[3] = {NULL, (void*)&arg__1, (void*)&arg__2}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("eventFilter", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWizard::eventFilter(arg__1, arg__2); } void PythonQtShell_QWizard::focusInEvent(QFocusEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "focusInEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QFocusEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizard::focusInEvent(arg__1); } bool PythonQtShell_QWizard::focusNextPrevChild(bool next) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "focusNextPrevChild"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "bool"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); bool returnValue; void* args[2] = {NULL, (void*)&next}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("focusNextPrevChild", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWizard::focusNextPrevChild(next); } void PythonQtShell_QWizard::focusOutEvent(QFocusEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "focusOutEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QFocusEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizard::focusOutEvent(arg__1); } int PythonQtShell_QWizard::heightForWidth(int arg__1) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "heightForWidth"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); int returnValue; void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("heightForWidth", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWizard::heightForWidth(arg__1); } void PythonQtShell_QWizard::hideEvent(QHideEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "hideEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QHideEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizard::hideEvent(arg__1); } void PythonQtShell_QWizard::initializePage(int id) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "initializePage"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&id}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizard::initializePage(id); } void PythonQtShell_QWizard::inputMethodEvent(QInputMethodEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "inputMethodEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QInputMethodEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizard::inputMethodEvent(arg__1); } QVariant PythonQtShell_QWizard::inputMethodQuery(Qt::InputMethodQuery arg__1) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "inputMethodQuery"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QVariant" , "Qt::InputMethodQuery"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); QVariant returnValue; void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("inputMethodQuery", methodInfo, result); } else { returnValue = *((QVariant*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWizard::inputMethodQuery(arg__1); } void PythonQtShell_QWizard::keyPressEvent(QKeyEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "keyPressEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QKeyEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizard::keyPressEvent(arg__1); } void PythonQtShell_QWizard::keyReleaseEvent(QKeyEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "keyReleaseEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QKeyEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizard::keyReleaseEvent(arg__1); } void PythonQtShell_QWizard::languageChange() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "languageChange"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={""}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizard::languageChange(); } void PythonQtShell_QWizard::leaveEvent(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "leaveEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizard::leaveEvent(arg__1); } int PythonQtShell_QWizard::metric(QPaintDevice::PaintDeviceMetric arg__1) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "metric"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int" , "QPaintDevice::PaintDeviceMetric"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); int returnValue; void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("metric", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWizard::metric(arg__1); } void PythonQtShell_QWizard::mouseDoubleClickEvent(QMouseEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mouseDoubleClickEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QMouseEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizard::mouseDoubleClickEvent(arg__1); } void PythonQtShell_QWizard::mouseMoveEvent(QMouseEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mouseMoveEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QMouseEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizard::mouseMoveEvent(arg__1); } void PythonQtShell_QWizard::mousePressEvent(QMouseEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mousePressEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QMouseEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizard::mousePressEvent(arg__1); } void PythonQtShell_QWizard::mouseReleaseEvent(QMouseEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mouseReleaseEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QMouseEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizard::mouseReleaseEvent(arg__1); } void PythonQtShell_QWizard::moveEvent(QMoveEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "moveEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QMoveEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizard::moveEvent(arg__1); } int PythonQtShell_QWizard::nextId() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "nextId"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); int returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("nextId", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWizard::nextId(); } QPaintEngine* PythonQtShell_QWizard::paintEngine() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "paintEngine"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QPaintEngine*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); QPaintEngine* returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("paintEngine", methodInfo, result); } else { returnValue = *((QPaintEngine**)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWizard::paintEngine(); } void PythonQtShell_QWizard::paintEvent(QPaintEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "paintEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QPaintEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizard::paintEvent(event); } void PythonQtShell_QWizard::reject() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "reject"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={""}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizard::reject(); } void PythonQtShell_QWizard::resizeEvent(QResizeEvent* event) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "resizeEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QResizeEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&event}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizard::resizeEvent(event); } void PythonQtShell_QWizard::showEvent(QShowEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "showEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QShowEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizard::showEvent(arg__1); } void PythonQtShell_QWizard::tabletEvent(QTabletEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "tabletEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QTabletEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizard::tabletEvent(arg__1); } void PythonQtShell_QWizard::timerEvent(QTimerEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "timerEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QTimerEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizard::timerEvent(arg__1); } bool PythonQtShell_QWizard::validateCurrentPage() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "validateCurrentPage"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); bool returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("validateCurrentPage", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWizard::validateCurrentPage(); } void PythonQtShell_QWizard::wheelEvent(QWheelEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "wheelEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QWheelEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizard::wheelEvent(arg__1); } QWizard* PythonQtWrapper_QWizard::new_QWizard(QWidget* parent, Qt::WindowFlags flags) { return new PythonQtShell_QWizard(parent, flags); } int PythonQtWrapper_QWizard::addPage(QWizard* theWrappedObject, QWizardPage* page) { return ( theWrappedObject->addPage(page)); } QAbstractButton* PythonQtWrapper_QWizard::button(QWizard* theWrappedObject, QWizard::WizardButton which) const { return ( theWrappedObject->button(which)); } QString PythonQtWrapper_QWizard::buttonText(QWizard* theWrappedObject, QWizard::WizardButton which) const { return ( theWrappedObject->buttonText(which)); } void PythonQtWrapper_QWizard::cleanupPage(QWizard* theWrappedObject, int id) { ( ((PythonQtPublicPromoter_QWizard*)theWrappedObject)->promoted_cleanupPage(id)); } int PythonQtWrapper_QWizard::currentId(QWizard* theWrappedObject) const { return ( theWrappedObject->currentId()); } QWizardPage* PythonQtWrapper_QWizard::currentPage(QWizard* theWrappedObject) const { return ( theWrappedObject->currentPage()); } void PythonQtWrapper_QWizard::done(QWizard* theWrappedObject, int result) { ( ((PythonQtPublicPromoter_QWizard*)theWrappedObject)->promoted_done(result)); } bool PythonQtWrapper_QWizard::event(QWizard* theWrappedObject, QEvent* event) { return ( ((PythonQtPublicPromoter_QWizard*)theWrappedObject)->promoted_event(event)); } QVariant PythonQtWrapper_QWizard::field(QWizard* theWrappedObject, const QString& name) const { return ( theWrappedObject->field(name)); } bool PythonQtWrapper_QWizard::hasVisitedPage(QWizard* theWrappedObject, int id) const { return ( theWrappedObject->hasVisitedPage(id)); } void PythonQtWrapper_QWizard::initializePage(QWizard* theWrappedObject, int id) { ( ((PythonQtPublicPromoter_QWizard*)theWrappedObject)->promoted_initializePage(id)); } int PythonQtWrapper_QWizard::nextId(QWizard* theWrappedObject) const { return ( ((PythonQtPublicPromoter_QWizard*)theWrappedObject)->promoted_nextId()); } QWizard::WizardOptions PythonQtWrapper_QWizard::options(QWizard* theWrappedObject) const { return ( theWrappedObject->options()); } QWizardPage* PythonQtWrapper_QWizard::page(QWizard* theWrappedObject, int id) const { return ( theWrappedObject->page(id)); } QList<int > PythonQtWrapper_QWizard::pageIds(QWizard* theWrappedObject) const { return ( theWrappedObject->pageIds()); } void PythonQtWrapper_QWizard::paintEvent(QWizard* theWrappedObject, QPaintEvent* event) { ( ((PythonQtPublicPromoter_QWizard*)theWrappedObject)->promoted_paintEvent(event)); } QPixmap PythonQtWrapper_QWizard::pixmap(QWizard* theWrappedObject, QWizard::WizardPixmap which) const { return ( theWrappedObject->pixmap(which)); } void PythonQtWrapper_QWizard::removePage(QWizard* theWrappedObject, int id) { ( theWrappedObject->removePage(id)); } void PythonQtWrapper_QWizard::resizeEvent(QWizard* theWrappedObject, QResizeEvent* event) { ( ((PythonQtPublicPromoter_QWizard*)theWrappedObject)->promoted_resizeEvent(event)); } void PythonQtWrapper_QWizard::setButton(QWizard* theWrappedObject, QWizard::WizardButton which, QAbstractButton* button) { ( theWrappedObject->setButton(which, button)); } void PythonQtWrapper_QWizard::setButtonLayout(QWizard* theWrappedObject, const QList<QWizard::WizardButton >& layout) { ( theWrappedObject->setButtonLayout(layout)); } void PythonQtWrapper_QWizard::setButtonText(QWizard* theWrappedObject, QWizard::WizardButton which, const QString& text) { ( theWrappedObject->setButtonText(which, text)); } void PythonQtWrapper_QWizard::setField(QWizard* theWrappedObject, const QString& name, const QVariant& value) { ( theWrappedObject->setField(name, value)); } void PythonQtWrapper_QWizard::setOption(QWizard* theWrappedObject, QWizard::WizardOption option, bool on) { ( theWrappedObject->setOption(option, on)); } void PythonQtWrapper_QWizard::setOptions(QWizard* theWrappedObject, QWizard::WizardOptions options) { ( theWrappedObject->setOptions(options)); } void PythonQtWrapper_QWizard::setPage(QWizard* theWrappedObject, int id, QWizardPage* page) { ( theWrappedObject->setPage(id, page)); } void PythonQtWrapper_QWizard::setPixmap(QWizard* theWrappedObject, QWizard::WizardPixmap which, const QPixmap& pixmap) { ( theWrappedObject->setPixmap(which, pixmap)); } void PythonQtWrapper_QWizard::setSideWidget(QWizard* theWrappedObject, QWidget* widget) { ( theWrappedObject->setSideWidget(widget)); } void PythonQtWrapper_QWizard::setStartId(QWizard* theWrappedObject, int id) { ( theWrappedObject->setStartId(id)); } void PythonQtWrapper_QWizard::setSubTitleFormat(QWizard* theWrappedObject, Qt::TextFormat format) { ( theWrappedObject->setSubTitleFormat(format)); } void PythonQtWrapper_QWizard::setTitleFormat(QWizard* theWrappedObject, Qt::TextFormat format) { ( theWrappedObject->setTitleFormat(format)); } void PythonQtWrapper_QWizard::setVisible(QWizard* theWrappedObject, bool visible) { ( theWrappedObject->setVisible(visible)); } void PythonQtWrapper_QWizard::setWizardStyle(QWizard* theWrappedObject, QWizard::WizardStyle style) { ( theWrappedObject->setWizardStyle(style)); } QWidget* PythonQtWrapper_QWizard::sideWidget(QWizard* theWrappedObject) const { return ( theWrappedObject->sideWidget()); } QSize PythonQtWrapper_QWizard::sizeHint(QWizard* theWrappedObject) const { return ( theWrappedObject->sizeHint()); } int PythonQtWrapper_QWizard::startId(QWizard* theWrappedObject) const { return ( theWrappedObject->startId()); } Qt::TextFormat PythonQtWrapper_QWizard::subTitleFormat(QWizard* theWrappedObject) const { return ( theWrappedObject->subTitleFormat()); } bool PythonQtWrapper_QWizard::testOption(QWizard* theWrappedObject, QWizard::WizardOption option) const { return ( theWrappedObject->testOption(option)); } Qt::TextFormat PythonQtWrapper_QWizard::titleFormat(QWizard* theWrappedObject) const { return ( theWrappedObject->titleFormat()); } bool PythonQtWrapper_QWizard::validateCurrentPage(QWizard* theWrappedObject) { return ( ((PythonQtPublicPromoter_QWizard*)theWrappedObject)->promoted_validateCurrentPage()); } QList<int > PythonQtWrapper_QWizard::visitedPages(QWizard* theWrappedObject) const { return ( theWrappedObject->visitedPages()); } QWizard::WizardStyle PythonQtWrapper_QWizard::wizardStyle(QWizard* theWrappedObject) const { return ( theWrappedObject->wizardStyle()); } void PythonQtShell_QWizardPage::actionEvent(QActionEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "actionEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QActionEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizardPage::actionEvent(arg__1); } void PythonQtShell_QWizardPage::changeEvent(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "changeEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizardPage::changeEvent(arg__1); } void PythonQtShell_QWizardPage::childEvent(QChildEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "childEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QChildEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizardPage::childEvent(arg__1); } void PythonQtShell_QWizardPage::cleanupPage() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "cleanupPage"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={""}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizardPage::cleanupPage(); } void PythonQtShell_QWizardPage::closeEvent(QCloseEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "closeEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QCloseEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizardPage::closeEvent(arg__1); } void PythonQtShell_QWizardPage::contextMenuEvent(QContextMenuEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "contextMenuEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QContextMenuEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizardPage::contextMenuEvent(arg__1); } void PythonQtShell_QWizardPage::customEvent(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "customEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizardPage::customEvent(arg__1); } int PythonQtShell_QWizardPage::devType() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "devType"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); int returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("devType", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWizardPage::devType(); } void PythonQtShell_QWizardPage::dragEnterEvent(QDragEnterEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dragEnterEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QDragEnterEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizardPage::dragEnterEvent(arg__1); } void PythonQtShell_QWizardPage::dragLeaveEvent(QDragLeaveEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dragLeaveEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QDragLeaveEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizardPage::dragLeaveEvent(arg__1); } void PythonQtShell_QWizardPage::dragMoveEvent(QDragMoveEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dragMoveEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QDragMoveEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizardPage::dragMoveEvent(arg__1); } void PythonQtShell_QWizardPage::dropEvent(QDropEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dropEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QDropEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizardPage::dropEvent(arg__1); } void PythonQtShell_QWizardPage::enterEvent(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "enterEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizardPage::enterEvent(arg__1); } bool PythonQtShell_QWizardPage::event(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "event"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); bool returnValue; void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("event", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWizardPage::event(arg__1); } bool PythonQtShell_QWizardPage::eventFilter(QObject* arg__1, QEvent* arg__2) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "eventFilter"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "QObject*" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); bool returnValue; void* args[3] = {NULL, (void*)&arg__1, (void*)&arg__2}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("eventFilter", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWizardPage::eventFilter(arg__1, arg__2); } void PythonQtShell_QWizardPage::focusInEvent(QFocusEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "focusInEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QFocusEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizardPage::focusInEvent(arg__1); } bool PythonQtShell_QWizardPage::focusNextPrevChild(bool next) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "focusNextPrevChild"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "bool"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); bool returnValue; void* args[2] = {NULL, (void*)&next}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("focusNextPrevChild", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWizardPage::focusNextPrevChild(next); } void PythonQtShell_QWizardPage::focusOutEvent(QFocusEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "focusOutEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QFocusEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizardPage::focusOutEvent(arg__1); } int PythonQtShell_QWizardPage::heightForWidth(int arg__1) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "heightForWidth"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); int returnValue; void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("heightForWidth", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWizardPage::heightForWidth(arg__1); } void PythonQtShell_QWizardPage::hideEvent(QHideEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "hideEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QHideEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizardPage::hideEvent(arg__1); } void PythonQtShell_QWizardPage::initializePage() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "initializePage"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={""}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizardPage::initializePage(); } void PythonQtShell_QWizardPage::inputMethodEvent(QInputMethodEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "inputMethodEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QInputMethodEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizardPage::inputMethodEvent(arg__1); } QVariant PythonQtShell_QWizardPage::inputMethodQuery(Qt::InputMethodQuery arg__1) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "inputMethodQuery"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QVariant" , "Qt::InputMethodQuery"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); QVariant returnValue; void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("inputMethodQuery", methodInfo, result); } else { returnValue = *((QVariant*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWizardPage::inputMethodQuery(arg__1); } bool PythonQtShell_QWizardPage::isComplete() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "isComplete"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); bool returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("isComplete", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWizardPage::isComplete(); } void PythonQtShell_QWizardPage::keyPressEvent(QKeyEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "keyPressEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QKeyEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizardPage::keyPressEvent(arg__1); } void PythonQtShell_QWizardPage::keyReleaseEvent(QKeyEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "keyReleaseEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QKeyEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizardPage::keyReleaseEvent(arg__1); } void PythonQtShell_QWizardPage::languageChange() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "languageChange"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={""}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizardPage::languageChange(); } void PythonQtShell_QWizardPage::leaveEvent(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "leaveEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizardPage::leaveEvent(arg__1); } int PythonQtShell_QWizardPage::metric(QPaintDevice::PaintDeviceMetric arg__1) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "metric"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int" , "QPaintDevice::PaintDeviceMetric"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); int returnValue; void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("metric", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWizardPage::metric(arg__1); } QSize PythonQtShell_QWizardPage::minimumSizeHint() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "getMinimumSizeHint"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QSize"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); QSize returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("getMinimumSizeHint", methodInfo, result); } else { returnValue = *((QSize*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWizardPage::minimumSizeHint(); } void PythonQtShell_QWizardPage::mouseDoubleClickEvent(QMouseEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mouseDoubleClickEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QMouseEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizardPage::mouseDoubleClickEvent(arg__1); } void PythonQtShell_QWizardPage::mouseMoveEvent(QMouseEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mouseMoveEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QMouseEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizardPage::mouseMoveEvent(arg__1); } void PythonQtShell_QWizardPage::mousePressEvent(QMouseEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mousePressEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QMouseEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizardPage::mousePressEvent(arg__1); } void PythonQtShell_QWizardPage::mouseReleaseEvent(QMouseEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mouseReleaseEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QMouseEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizardPage::mouseReleaseEvent(arg__1); } void PythonQtShell_QWizardPage::moveEvent(QMoveEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "moveEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QMoveEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizardPage::moveEvent(arg__1); } int PythonQtShell_QWizardPage::nextId() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "nextId"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); int returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("nextId", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWizardPage::nextId(); } QPaintEngine* PythonQtShell_QWizardPage::paintEngine() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "paintEngine"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QPaintEngine*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); QPaintEngine* returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("paintEngine", methodInfo, result); } else { returnValue = *((QPaintEngine**)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWizardPage::paintEngine(); } void PythonQtShell_QWizardPage::paintEvent(QPaintEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "paintEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QPaintEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizardPage::paintEvent(arg__1); } void PythonQtShell_QWizardPage::resizeEvent(QResizeEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "resizeEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QResizeEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizardPage::resizeEvent(arg__1); } void PythonQtShell_QWizardPage::showEvent(QShowEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "showEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QShowEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizardPage::showEvent(arg__1); } QSize PythonQtShell_QWizardPage::sizeHint() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "getSizeHint"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QSize"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); QSize returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("getSizeHint", methodInfo, result); } else { returnValue = *((QSize*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWizardPage::sizeHint(); } void PythonQtShell_QWizardPage::tabletEvent(QTabletEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "tabletEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QTabletEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizardPage::tabletEvent(arg__1); } void PythonQtShell_QWizardPage::timerEvent(QTimerEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "timerEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QTimerEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizardPage::timerEvent(arg__1); } bool PythonQtShell_QWizardPage::validatePage() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "validatePage"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); bool returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("validatePage", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWizardPage::validatePage(); } void PythonQtShell_QWizardPage::wheelEvent(QWheelEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "wheelEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QWheelEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWizardPage::wheelEvent(arg__1); } QWizardPage* PythonQtWrapper_QWizardPage::new_QWizardPage(QWidget* parent) { return new PythonQtShell_QWizardPage(parent); } QString PythonQtWrapper_QWizardPage::buttonText(QWizardPage* theWrappedObject, QWizard::WizardButton which) const { return ( theWrappedObject->buttonText(which)); } void PythonQtWrapper_QWizardPage::cleanupPage(QWizardPage* theWrappedObject) { ( ((PythonQtPublicPromoter_QWizardPage*)theWrappedObject)->promoted_cleanupPage()); } void PythonQtWrapper_QWizardPage::initializePage(QWizardPage* theWrappedObject) { ( ((PythonQtPublicPromoter_QWizardPage*)theWrappedObject)->promoted_initializePage()); } bool PythonQtWrapper_QWizardPage::isCommitPage(QWizardPage* theWrappedObject) const { return ( theWrappedObject->isCommitPage()); } bool PythonQtWrapper_QWizardPage::isComplete(QWizardPage* theWrappedObject) const { return ( ((PythonQtPublicPromoter_QWizardPage*)theWrappedObject)->promoted_isComplete()); } bool PythonQtWrapper_QWizardPage::isFinalPage(QWizardPage* theWrappedObject) const { return ( theWrappedObject->isFinalPage()); } int PythonQtWrapper_QWizardPage::nextId(QWizardPage* theWrappedObject) const { return ( ((PythonQtPublicPromoter_QWizardPage*)theWrappedObject)->promoted_nextId()); } QPixmap PythonQtWrapper_QWizardPage::pixmap(QWizardPage* theWrappedObject, QWizard::WizardPixmap which) const { return ( theWrappedObject->pixmap(which)); } void PythonQtWrapper_QWizardPage::setButtonText(QWizardPage* theWrappedObject, QWizard::WizardButton which, const QString& text) { ( theWrappedObject->setButtonText(which, text)); } void PythonQtWrapper_QWizardPage::setCommitPage(QWizardPage* theWrappedObject, bool commitPage) { ( theWrappedObject->setCommitPage(commitPage)); } void PythonQtWrapper_QWizardPage::setFinalPage(QWizardPage* theWrappedObject, bool finalPage) { ( theWrappedObject->setFinalPage(finalPage)); } void PythonQtWrapper_QWizardPage::setPixmap(QWizardPage* theWrappedObject, QWizard::WizardPixmap which, const QPixmap& pixmap) { ( theWrappedObject->setPixmap(which, pixmap)); } void PythonQtWrapper_QWizardPage::setSubTitle(QWizardPage* theWrappedObject, const QString& subTitle) { ( theWrappedObject->setSubTitle(subTitle)); } void PythonQtWrapper_QWizardPage::setTitle(QWizardPage* theWrappedObject, const QString& title) { ( theWrappedObject->setTitle(title)); } QString PythonQtWrapper_QWizardPage::subTitle(QWizardPage* theWrappedObject) const { return ( theWrappedObject->subTitle()); } QString PythonQtWrapper_QWizardPage::title(QWizardPage* theWrappedObject) const { return ( theWrappedObject->title()); } bool PythonQtWrapper_QWizardPage::validatePage(QWizardPage* theWrappedObject) { return ( ((PythonQtPublicPromoter_QWizardPage*)theWrappedObject)->promoted_validatePage()); } void PythonQtShell_QWorkspace::actionEvent(QActionEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "actionEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QActionEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWorkspace::actionEvent(arg__1); } void PythonQtShell_QWorkspace::changeEvent(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "changeEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWorkspace::changeEvent(arg__1); } void PythonQtShell_QWorkspace::childEvent(QChildEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "childEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QChildEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWorkspace::childEvent(arg__1); } void PythonQtShell_QWorkspace::closeEvent(QCloseEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "closeEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QCloseEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWorkspace::closeEvent(arg__1); } void PythonQtShell_QWorkspace::contextMenuEvent(QContextMenuEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "contextMenuEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QContextMenuEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWorkspace::contextMenuEvent(arg__1); } void PythonQtShell_QWorkspace::customEvent(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "customEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWorkspace::customEvent(arg__1); } int PythonQtShell_QWorkspace::devType() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "devType"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); int returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("devType", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWorkspace::devType(); } void PythonQtShell_QWorkspace::dragEnterEvent(QDragEnterEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dragEnterEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QDragEnterEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWorkspace::dragEnterEvent(arg__1); } void PythonQtShell_QWorkspace::dragLeaveEvent(QDragLeaveEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dragLeaveEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QDragLeaveEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWorkspace::dragLeaveEvent(arg__1); } void PythonQtShell_QWorkspace::dragMoveEvent(QDragMoveEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dragMoveEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QDragMoveEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWorkspace::dragMoveEvent(arg__1); } void PythonQtShell_QWorkspace::dropEvent(QDropEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "dropEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QDropEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWorkspace::dropEvent(arg__1); } void PythonQtShell_QWorkspace::enterEvent(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "enterEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWorkspace::enterEvent(arg__1); } bool PythonQtShell_QWorkspace::event(QEvent* e) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "event"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); bool returnValue; void* args[2] = {NULL, (void*)&e}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("event", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWorkspace::event(e); } bool PythonQtShell_QWorkspace::eventFilter(QObject* arg__1, QEvent* arg__2) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "eventFilter"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "QObject*" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); bool returnValue; void* args[3] = {NULL, (void*)&arg__1, (void*)&arg__2}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("eventFilter", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWorkspace::eventFilter(arg__1, arg__2); } void PythonQtShell_QWorkspace::focusInEvent(QFocusEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "focusInEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QFocusEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWorkspace::focusInEvent(arg__1); } bool PythonQtShell_QWorkspace::focusNextPrevChild(bool next) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "focusNextPrevChild"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"bool" , "bool"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); bool returnValue; void* args[2] = {NULL, (void*)&next}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("focusNextPrevChild", methodInfo, result); } else { returnValue = *((bool*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWorkspace::focusNextPrevChild(next); } void PythonQtShell_QWorkspace::focusOutEvent(QFocusEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "focusOutEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QFocusEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWorkspace::focusOutEvent(arg__1); } int PythonQtShell_QWorkspace::heightForWidth(int arg__1) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "heightForWidth"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int" , "int"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); int returnValue; void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("heightForWidth", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWorkspace::heightForWidth(arg__1); } void PythonQtShell_QWorkspace::hideEvent(QHideEvent* e) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "hideEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QHideEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&e}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWorkspace::hideEvent(e); } void PythonQtShell_QWorkspace::inputMethodEvent(QInputMethodEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "inputMethodEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QInputMethodEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWorkspace::inputMethodEvent(arg__1); } QVariant PythonQtShell_QWorkspace::inputMethodQuery(Qt::InputMethodQuery arg__1) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "inputMethodQuery"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QVariant" , "Qt::InputMethodQuery"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); QVariant returnValue; void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("inputMethodQuery", methodInfo, result); } else { returnValue = *((QVariant*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWorkspace::inputMethodQuery(arg__1); } void PythonQtShell_QWorkspace::keyPressEvent(QKeyEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "keyPressEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QKeyEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWorkspace::keyPressEvent(arg__1); } void PythonQtShell_QWorkspace::keyReleaseEvent(QKeyEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "keyReleaseEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QKeyEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWorkspace::keyReleaseEvent(arg__1); } void PythonQtShell_QWorkspace::languageChange() { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "languageChange"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={""}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWorkspace::languageChange(); } void PythonQtShell_QWorkspace::leaveEvent(QEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "leaveEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWorkspace::leaveEvent(arg__1); } int PythonQtShell_QWorkspace::metric(QPaintDevice::PaintDeviceMetric arg__1) const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "metric"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"int" , "QPaintDevice::PaintDeviceMetric"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); int returnValue; void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("metric", methodInfo, result); } else { returnValue = *((int*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWorkspace::metric(arg__1); } QSize PythonQtShell_QWorkspace::minimumSizeHint() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "getMinimumSizeHint"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QSize"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); QSize returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("getMinimumSizeHint", methodInfo, result); } else { returnValue = *((QSize*)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWorkspace::minimumSizeHint(); } void PythonQtShell_QWorkspace::mouseDoubleClickEvent(QMouseEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mouseDoubleClickEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QMouseEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWorkspace::mouseDoubleClickEvent(arg__1); } void PythonQtShell_QWorkspace::mouseMoveEvent(QMouseEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mouseMoveEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QMouseEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWorkspace::mouseMoveEvent(arg__1); } void PythonQtShell_QWorkspace::mousePressEvent(QMouseEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mousePressEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QMouseEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWorkspace::mousePressEvent(arg__1); } void PythonQtShell_QWorkspace::mouseReleaseEvent(QMouseEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "mouseReleaseEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QMouseEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWorkspace::mouseReleaseEvent(arg__1); } void PythonQtShell_QWorkspace::moveEvent(QMoveEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "moveEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QMoveEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWorkspace::moveEvent(arg__1); } QPaintEngine* PythonQtShell_QWorkspace::paintEngine() const { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "paintEngine"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"QPaintEngine*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); QPaintEngine* returnValue; void* args[1] = {NULL}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); if (args[0]!=&returnValue) { if (args[0]==NULL) { PythonQt::priv()->handleVirtualOverloadReturnError("paintEngine", methodInfo, result); } else { returnValue = *((QPaintEngine**)args[0]); } } } if (result) { Py_DECREF(result); } Py_DECREF(obj); return returnValue; } } return QWorkspace::paintEngine(); } void PythonQtShell_QWorkspace::paintEvent(QPaintEvent* e) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "paintEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QPaintEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&e}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWorkspace::paintEvent(e); } void PythonQtShell_QWorkspace::resizeEvent(QResizeEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "resizeEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QResizeEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWorkspace::resizeEvent(arg__1); } void PythonQtShell_QWorkspace::showEvent(QShowEvent* e) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "showEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QShowEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&e}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWorkspace::showEvent(e); } void PythonQtShell_QWorkspace::tabletEvent(QTabletEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "tabletEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QTabletEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWorkspace::tabletEvent(arg__1); } void PythonQtShell_QWorkspace::timerEvent(QTimerEvent* arg__1) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "timerEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QTimerEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&arg__1}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWorkspace::timerEvent(arg__1); } void PythonQtShell_QWorkspace::wheelEvent(QWheelEvent* e) { if (_wrapper) { PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "wheelEvent"); PyErr_Clear(); if (obj && !PythonQtSlotFunction_Check(obj)) { static const char* argumentList[] ={"" , "QWheelEvent*"}; static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); void* args[2] = {NULL, (void*)&e}; PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); if (result) { Py_DECREF(result); } Py_DECREF(obj); return; } } QWorkspace::wheelEvent(e); } QWorkspace* PythonQtWrapper_QWorkspace::new_QWorkspace(QWidget* parent) { return new PythonQtShell_QWorkspace(parent); } QWidget* PythonQtWrapper_QWorkspace::activeWindow(QWorkspace* theWrappedObject) const { return ( theWrappedObject->activeWindow()); } QWidget* PythonQtWrapper_QWorkspace::addWindow(QWorkspace* theWrappedObject, QWidget* w, Qt::WindowFlags flags) { return ( theWrappedObject->addWindow(w, flags)); } QBrush PythonQtWrapper_QWorkspace::background(QWorkspace* theWrappedObject) const { return ( theWrappedObject->background()); } void PythonQtWrapper_QWorkspace::changeEvent(QWorkspace* theWrappedObject, QEvent* arg__1) { ( ((PythonQtPublicPromoter_QWorkspace*)theWrappedObject)->promoted_changeEvent(arg__1)); } void PythonQtWrapper_QWorkspace::childEvent(QWorkspace* theWrappedObject, QChildEvent* arg__1) { ( ((PythonQtPublicPromoter_QWorkspace*)theWrappedObject)->promoted_childEvent(arg__1)); } bool PythonQtWrapper_QWorkspace::event(QWorkspace* theWrappedObject, QEvent* e) { return ( ((PythonQtPublicPromoter_QWorkspace*)theWrappedObject)->promoted_event(e)); } bool PythonQtWrapper_QWorkspace::eventFilter(QWorkspace* theWrappedObject, QObject* arg__1, QEvent* arg__2) { return ( ((PythonQtPublicPromoter_QWorkspace*)theWrappedObject)->promoted_eventFilter(arg__1, arg__2)); } void PythonQtWrapper_QWorkspace::hideEvent(QWorkspace* theWrappedObject, QHideEvent* e) { ( ((PythonQtPublicPromoter_QWorkspace*)theWrappedObject)->promoted_hideEvent(e)); } void PythonQtWrapper_QWorkspace::paintEvent(QWorkspace* theWrappedObject, QPaintEvent* e) { ( ((PythonQtPublicPromoter_QWorkspace*)theWrappedObject)->promoted_paintEvent(e)); } void PythonQtWrapper_QWorkspace::resizeEvent(QWorkspace* theWrappedObject, QResizeEvent* arg__1) { ( ((PythonQtPublicPromoter_QWorkspace*)theWrappedObject)->promoted_resizeEvent(arg__1)); } bool PythonQtWrapper_QWorkspace::scrollBarsEnabled(QWorkspace* theWrappedObject) const { return ( theWrappedObject->scrollBarsEnabled()); } void PythonQtWrapper_QWorkspace::setBackground(QWorkspace* theWrappedObject, const QBrush& background) { ( theWrappedObject->setBackground(background)); } void PythonQtWrapper_QWorkspace::setScrollBarsEnabled(QWorkspace* theWrappedObject, bool enable) { ( theWrappedObject->setScrollBarsEnabled(enable)); } void PythonQtWrapper_QWorkspace::showEvent(QWorkspace* theWrappedObject, QShowEvent* e) { ( ((PythonQtPublicPromoter_QWorkspace*)theWrappedObject)->promoted_showEvent(e)); } QSize PythonQtWrapper_QWorkspace::sizeHint(QWorkspace* theWrappedObject) const { return ( theWrappedObject->sizeHint()); } void PythonQtWrapper_QWorkspace::wheelEvent(QWorkspace* theWrappedObject, QWheelEvent* e) { ( ((PythonQtPublicPromoter_QWorkspace*)theWrappedObject)->promoted_wheelEvent(e)); } QList<QWidget* > PythonQtWrapper_QWorkspace::windowList(QWorkspace* theWrappedObject, QWorkspace::WindowOrder order) const { return ( theWrappedObject->windowList(order)); }
[ "antmanler@gmail.com" ]
antmanler@gmail.com
14cf6691ba4623ae08bd51da807e5e77ae26d94d
a865775d3502224a2e9544ec3f2c1ac0db2e0868
/models/stock.h
acae697e11921b431adcb641aa6b85e5863033e7
[]
no_license
webclinic017/ampanov
c3afcc08f9dae78dcfe385b9860d9bd5050a43e4
1d19051b975714f7a2b8b3c82a2906998a7493c5
refs/heads/master
2022-03-30T06:57:33.635946
2020-01-19T18:12:05
2020-01-19T18:12:05
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,271
h
#ifndef STOCKMODEL_H #define STOCKMODEL_H #include "core/database.h" #include "core/zeromq.h" struct Stock { int rowid = 0; QString status = ""; QString symbol = ""; int symbol_id = 0; QString description = ""; QString currency = ""; QString exchange = ""; int trade_unit = 0; bool is_index = false; bool is_tradable = false; bool is_quotable = false; bool has_options = false; QString security_type = ""; double prev_day_close_price = 0; double high_price_52 = 0; double low_price_52 = 0; uint average_vol_90 = 0; uint average_vol_20 = 0; uint outstanding_shares = 0; QString industry_sector = ""; QString industry_group = ""; QString industry_subgroup = ""; QDateTime last_update; QString last_update_by = ""; double last_price = 0; int last_price_volume = 0; QDateTime last_price_time; QJsonObject toJsonObject() { QJsonObject data; data["last_price"] = QString::number( last_price, 'f', 2 ); data["last_price_volume"] = QString::number(last_price_volume); data["last_price_time"] = last_price_time.toString(); data["change"] = QString::number( last_price - prev_day_close_price, 'f', 2 ); return data; } }; typedef QList<Stock> Stocks; class StockModel : public Database { public: static Stocks select_all_active(); static Stock select_one_symbol(int symbol_id); static Stock select_one_row(int rowid); static bool save(Stock data); static bool update_last_price(int symbol_id, double last_price, int last_volume, QDateTime last_time); private: static Stocks fetchAll(QSqlQuery query); static Stock fetch(QSqlQuery &query); static bool zmqEmit(Stock stock); }; #endif // STOCKMODEL_H
[ "mgladkowski@axyz.com" ]
mgladkowski@axyz.com
36d1bc672d35ba83596b83c49ba9f3c6249ecce5
2ec630d6652a71f1b4f8c9f36f9d92505ecb1da8
/src/MiniCards.ino
19bff6e6fb81db683f8959d05bb9383e283e1f8a
[]
no_license
EspeuteClement/Minicards
6e3f4d3df3fa00c6b4119f7d72ebc329932c422b
605349d31d283faf2291bbb2048e57c1fa904cdc
refs/heads/master
2021-04-06T04:31:35.310868
2018-03-11T23:23:06
2018-03-11T23:23:06
124,809,017
0
0
null
null
null
null
UTF-8
C++
false
false
2,627
ino
#include <Gamebuino-Meta.h> #include "Styx.h" void setup() { gb.begin(); Styx::LoadImages(); Styx::Init(); } void loop() { if (gb.update()) { Styx::Update(); gb.display.clear(WHITE); Styx::Draw(); } } void Styx::SetColor(uint8_t color_index) { Gamebuino_Meta::Graphics::tint = *(uint16_t *) ColorTable[color_index]; } void Styx::DrawImage(uint8_t bank, uint8_t id, int16_t x, int16_t y, ImageFlip flip) { Image * img = (Image*)(Styx::ImageData[bank].ptr); int16_t width = Styx::ImageData[bank].spr_width; int16_t height = Styx::ImageData[bank].spr_height; img->setFrame(id); switch (flip) { case ImageFlip::NONE : gb.display.drawImage(x,y, *img); break; case ImageFlip::H_FLIP : gb.display.drawImage(x,y, *img, -width, height); break; case ImageFlip::V_FLIP : gb.display.drawImage(x,y+height, *img, width, -height); break; case ImageFlip ::HV_FLIP : gb.display.drawImage(x+width,y+height, *img, -width, -height); break; } } bool Styx::IsDown(Styx::Buttons button) { switch (button) { case BTN_A: return gb.buttons.repeat(BUTTON_A,0); break; case BTN_B: return gb.buttons.repeat(BUTTON_B,0); break; case BTN_MENU: return gb.buttons.repeat(BUTTON_MENU,0); break; case BTN_UP: return gb.buttons.repeat(BUTTON_UP,0); break; case BTN_DOWN: return gb.buttons.repeat(BUTTON_DOWN,0); break; case BTN_LEFT: return gb.buttons.repeat(BUTTON_LEFT,0); break; case BTN_RIGHT: return gb.buttons.repeat(BUTTON_RIGHT,0); break; } return false; } bool Styx::IsPressed(Styx::Buttons button) { switch (button) { case BTN_A: return gb.buttons.pressed(BUTTON_A); break; case BTN_B: return gb.buttons.pressed(BUTTON_B); break; case BTN_MENU: return gb.buttons.pressed(BUTTON_MENU); break; case BTN_UP: return gb.buttons.pressed(BUTTON_UP); break; case BTN_DOWN: return gb.buttons.pressed(BUTTON_DOWN); break; case BTN_LEFT: return gb.buttons.pressed(BUTTON_LEFT); break; case BTN_RIGHT: return gb.buttons.pressed(BUTTON_RIGHT); break; } return false; }
[ "espeut.clement@gmail.com" ]
espeut.clement@gmail.com
0ad2c1b7d0f708602e8a7bef98f1f3397ee59c41
61c325f099f251c22f13ac454c974ca7831d9077
/src/rpcdump.cpp
65d1b2a93c6b9f1a7590b1e1681aa564865f8a62
[ "MIT" ]
permissive
freshbtcer/kidzcoinz
96ceec623600ec31f419a33f802400dcf9290bdf
3c98653b38df8283caa9c1f7eefa5e524d067f0e
refs/heads/master
2021-07-05T14:40:04.915647
2017-10-01T06:17:34
2017-10-01T06:17:34
105,417,036
0
0
null
null
null
null
UTF-8
C++
false
false
3,008
cpp
// Copyright (c) 2009-2014 Bitcoin Developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "init.h" // for pwalletMain #include "bitcoinrpc.h" #include "ui_interface.h" #include "base58.h" #include <boost/lexical_cast.hpp> #define printf OutputDebugStringF using namespace json_spirit; using namespace std; class CTxDump { public: CBlockIndex *pindex; int64 nValue; bool fSpent; CWalletTx* ptx; int nOut; CTxDump(CWalletTx* ptx = NULL, int nOut = -1) { pindex = NULL; nValue = 0; fSpent = false; this->ptx = ptx; this->nOut = nOut; } }; Value importprivkey(const Array& params, bool fHelp) { if (fHelp || params.size() < 1 || params.size() > 3) throw runtime_error( "importprivkey <kidzcoinzprivkey> [label] [rescan=true]\n" "Adds a private key (as returned by dumpprivkey) to your wallet."); EnsureWalletIsUnlocked(); string strSecret = params[0].get_str(); string strLabel = ""; if (params.size() > 1) strLabel = params[1].get_str(); // Whether to perform rescan after import bool fRescan = true; if (params.size() > 2) fRescan = params[2].get_bool(); CBitcoinSecret vchSecret; bool fGood = vchSecret.SetString(strSecret); if (!fGood) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid private key encoding"); CKey key = vchSecret.GetKey(); CPubKey pubkey = key.GetPubKey(); CKeyID vchAddress = pubkey.GetID(); if (!key.IsValid()) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Private key outside allowed range"); { LOCK2(cs_main, pwalletMain->cs_wallet); pwalletMain->MarkDirty(); pwalletMain->SetAddressBookName(vchAddress, strLabel); if (!pwalletMain->AddKeyPubKey(key, pubkey)) throw JSONRPCError(RPC_WALLET_ERROR, "Error adding key to wallet"); if (fRescan) { pwalletMain->ScanForWalletTransactions(pindexGenesisBlock, true); pwalletMain->ReacceptWalletTransactions(); } } return Value::null; } Value dumpprivkey(const Array& params, bool fHelp) { if (fHelp || params.size() != 1) throw runtime_error( "dumpprivkey <kidzcoinzaddress>\n" "Reveals the private key corresponding to <kidzcoinzaddress>."); string strAddress = params[0].get_str(); CBitcoinAddress address; if (!address.SetString(strAddress)) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid KidzCoinz address"); CKeyID keyID; if (!address.GetKeyID(keyID)) throw JSONRPCError(RPC_TYPE_ERROR, "Address does not refer to a key"); CKey vchSecret; if (!pwalletMain->GetKey(keyID, vchSecret)) throw JSONRPCError(RPC_WALLET_ERROR, "Private key for address " + strAddress + " is not known"); return CBitcoinSecret(vchSecret).ToString(); }
[ "freshbtcer@gmail.com" ]
freshbtcer@gmail.com
3e359ef751092826c80ee6d6d62f70a00612ac8e
cb4516492965c75d14c9d499c387d3cd0b883bc4
/X3/Section 2 - Rendering Techniques/2.2 Dean Calver/GBufferMRT.cpp
e052fdc79b3662963529330710b95d2aa96ad4f8
[ "LicenseRef-scancode-warranty-disclaimer", "LicenseRef-scancode-public-domain" ]
permissive
nedma/ShaderX
48367dfc1153e4e6ad6bb5c205777285b06376c5
0503dd6ae16f3d288f2e27b0f93ebdfbaf1f4436
refs/heads/master
2020-04-08T01:51:11.173038
2018-11-24T08:37:42
2018-11-24T08:37:42
158,911,553
0
3
null
null
null
null
UTF-8
C++
false
false
8,355
cpp
//----------------------------------------------------------------------------- // File: GBufferMRT.cpp // // Desc: GBufferMRT class manages to the MRT //----------------------------------------------------------------------------- #include "dxstdafx.h" #include "GBufferMRT.h" // NOTES : 16Bit INT format is a good comprimise between the size of FLOAT32 and the precision // needed to store positions etc // I might seem more worthwhile to have different buffers at different bitdepth but this has // compitibity issues that I don't want to address here (ATI Radeon 9700 MRT requires same bitdepths) //D3DFORMAT GBufferMRT::m_FatFormat = D3DFMT_A16B16G16R16; // a 16bit INTEGER format D3DFORMAT GBufferMRT::m_FatFormat = D3DFMT_A32B32G32R32F; // a 32bit FLOAT format //----------------------------------------------------------------------------- // Name: GBufferMRT ctor //----------------------------------------------------------------------------- GBufferMRT::GBufferMRT( LPDIRECT3D9 pD3D, LPDIRECT3DDEVICE9 pD3DDevice ) : m_pD3D(pD3D), m_pD3DDevice(pD3DDevice) { assert( m_pD3D != 0 ); assert( m_pD3DDevice != 0 ); m_pD3D->AddRef(); m_pD3DDevice->AddRef(); D3DCAPS9 d3dCaps; m_pD3DDevice->GetDeviceCaps( &d3dCaps ); m_numSimulRT = min(d3dCaps.NumSimultaneousRTs,NUMBER_PARAMETER_SURFACES); } //----------------------------------------------------------------------------- // Name: GBufferMRT dtor //----------------------------------------------------------------------------- GBufferMRT::~GBufferMRT() { SAFE_RELEASE( m_pFatDepth ); for(unsigned int i=0;i < NUMBER_PARAMETER_SURFACES; ++i) { SAFE_RELEASE( m_pFatSurface[i] ); SAFE_RELEASE( m_pFatTexture[i] ); } SAFE_RELEASE( m_pD3D ); SAFE_RELEASE( m_pD3DDevice ); } //----------------------------------------------------------------------------- // Name: GBufferMRT Create buffers // Desc: Creates the buffers of the size requested //----------------------------------------------------------------------------- bool GBufferMRT::CreateBuffers( unsigned int width, unsigned int height ) { HRESULT hRes; // create the fat framebuffer for(unsigned int i=0;i < NUMBER_PARAMETER_SURFACES; ++i) { hRes = m_pD3DDevice->CreateTexture( width, // size should be >= to backbuffer height, 1, // mipmaps TODO? D3DUSAGE_RENDERTARGET, // render target obviously m_FatFormat, // format our fat framebuffer is made up of D3DPOOL_DEFAULT, // render target cannot be managed &m_pFatTexture[i], //dest ptr 0 // ignored ); if( FAILED(hRes) ) return false; m_pFatTexture[i]->GetSurfaceLevel( 0, &m_pFatSurface[i] ); } // create the depth/stencil buffer we will use when rendering into the fat framebuffer // Discard? multisample? hRes = m_pD3DDevice->CreateDepthStencilSurface( width, // size should be >= to backbuffer height, D3DFMT_D24S8, // format (TODO option for float depth?) D3DMULTISAMPLE_NONE, // multisample 0, // Multisample quality FALSE, // Discard TODO? &m_pFatDepth, // dest 0 // ignored ); m_Width = width; m_Height = height; return true; } //----------------------------------------------------------------------------- // Name: GBufferMRT GetRenderPassCount // Desc: How many passes to fill the GBuffer (for 4 simul MRT, only 1 pass) //----------------------------------------------------------------------------- unsigned int GBufferMRT::GetRenderPassCount() { return NUMBER_PARAMETER_SURFACES / m_numSimulRT; } //----------------------------------------------------------------------------- // Name: GBufferMRT SelectBuffersAsRenderTarget // Desc: Which buffer to render to //----------------------------------------------------------------------------- // you MUST select render targets starting at 0 (no gaps) void GBufferMRT::SelectBuffersAsRenderTarget( unsigned int buffers ) { if(buffers == 0) return; assert( buffers & FFB_BUFFER0 ); // D3D requires RT0 to have a target if( buffers & FFB_DEPTH | buffers & FFB_STENCIL ) m_pD3DDevice->SetDepthStencilSurface( m_pFatDepth ); else m_pD3DDevice->SetDepthStencilSurface( 0 ); unsigned int numTargets = 0; if( buffers & FFB_BUFFER0 ) { m_pD3DDevice->SetRenderTarget( 0, m_pFatSurface[0] ); numTargets++; if( buffers & FFB_BUFFER1 ) { m_pD3DDevice->SetRenderTarget( 1, m_pFatSurface[1] ); numTargets++; if( buffers & FFB_BUFFER2 ) { m_pD3DDevice->SetRenderTarget( 2, m_pFatSurface[2] ); numTargets++; if( buffers & FFB_BUFFER3 ) { m_pD3DDevice->SetRenderTarget( 3, m_pFatSurface[3] ); numTargets++; } } } } while( numTargets < 4 ) m_pD3DDevice->SetRenderTarget( numTargets++, 0 ); } //----------------------------------------------------------------------------- // Name: GBufferMRT SelectBufferAsTexture // Desc: Buffer is selected in the specified sampler //----------------------------------------------------------------------------- void GBufferMRT::SelectBufferAsTexture( FFB_BUFFER_NAME name, unsigned int samplerNum ) { // depth textures etc are largely not supported so I don't use them assert( !(name & FFB_DEPTH || name & FFB_STENCIL ) ); m_pD3DDevice->SetTexture( samplerNum, GetBufferTexture(name) ); } //----------------------------------------------------------------------------- // Name: GBufferMRT GetBufferTexture // Desc: return specified Buffer as a texture //----------------------------------------------------------------------------- LPDIRECT3DTEXTURE9 GBufferMRT::GetBufferTexture( FFB_BUFFER_NAME name) { // depth textures etc are largely not supported so I don't use them assert( !(name & FFB_DEPTH || name & FFB_STENCIL ) ); if( name & FFB_BUFFER0 ) return m_pFatTexture[0]; else if( name & FFB_BUFFER1 ) return m_pFatTexture[1]; else if( name & FFB_BUFFER2 ) return m_pFatTexture[2]; else if( name & FFB_BUFFER3 ) return m_pFatTexture[3]; else return 0; } //----------------------------------------------------------------------------- // Name: GBufferMRT GetBufferSurface // Desc: return specified Buffer as a surface //----------------------------------------------------------------------------- LPDIRECT3DSURFACE9 GBufferMRT::GetBufferSurface( FFB_BUFFER_NAME name ) { if( (name & FFB_DEPTH || name & FFB_STENCIL ) ) return m_pFatDepth; else if( name & FFB_BUFFER0 ) return m_pFatSurface[0]; else if( name & FFB_BUFFER1 ) return m_pFatSurface[1]; else if( name & FFB_BUFFER2 ) return m_pFatSurface[2]; else if( name & FFB_BUFFER3 ) return m_pFatSurface[3]; else return 0; } //----------------------------------------------------------------------------- // Name: GBufferMRT Clear // Desc: Clears the specified buffers (don't be too clever...) //----------------------------------------------------------------------------- void GBufferMRT::Clear( unsigned int buffers, unsigned int colour, float ZVal, unsigned int StencilVal ) { unsigned int flags = 0; if( buffers != 0 ) { unsigned int curTarget = 0; // debug complains if we select the same buffer several times... for(unsigned int i=1;i < 4;i++) m_pD3DDevice->SetRenderTarget( i, 0 ); if( buffers & FFB_BUFFER0 ) m_pD3DDevice->SetRenderTarget( curTarget++, m_pFatSurface[0] ); if( buffers & FFB_BUFFER1 ) m_pD3DDevice->SetRenderTarget( curTarget++, m_pFatSurface[1] ); if( buffers & FFB_BUFFER2 ) m_pD3DDevice->SetRenderTarget( curTarget++, m_pFatSurface[2] ); if( buffers & FFB_BUFFER3 ) m_pD3DDevice->SetRenderTarget( curTarget++, m_pFatSurface[3] ); if( curTarget != 0 ) { flags |= D3DCLEAR_TARGET; } if( buffers & FFB_DEPTH || buffers & FFB_STENCIL ) { m_pD3DDevice->SetDepthStencilSurface( m_pFatDepth ); if( buffers & FFB_DEPTH ) flags |= D3DCLEAR_ZBUFFER; if( buffers & FFB_STENCIL ) flags |= D3DCLEAR_STENCIL; } m_pD3DDevice->Clear( 0L, NULL, flags, colour, ZVal, StencilVal ); } }
[ "realned_07@163.com" ]
realned_07@163.com
4e8035ec047a25cc09b2d335f83baa3b6cbf724c
dadaa057480479e3796063c7f0ee03b5d7775642
/4. Conditions/20321016/1.BetterSqEq/1.BetterSqEq.cpp
af991848aaaf69e843f252e8ad272979743e46b6
[ "MIT" ]
permissive
Mitaka01-eng/CS104
8c5f45cd70098d5f06764c022bc03eca52217250
5281b1519e0cf41f314003112a811747a2143bd4
refs/heads/main
2023-03-27T18:14:17.934925
2021-03-30T16:08:47
2021-03-30T16:08:47
null
0
0
null
null
null
null
UTF-8
C++
false
false
807
cpp
// 1.BetterSqEq.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include <iostream> #include <cmath> using namespace std; int main() { int a, b, c; cout << "a=?, b=?, c=?" << endl; cin >> a >> b >> c; float d = pow(b, 2) - 4 * a * c; if (d < 0) { cout << "No Real Solutions." << endl; } if (d == 0) { float x = (-b) / (2 * a); cout << "d=0" << endl; cout << "x1=x2" << endl; cout << "x=" << x << endl; } if (d > 0) { float x1 = ((-b) + sqrt(d)) / (2 * a); float x2 = ((-b) - sqrt(d)) / (2 * a); cout << "d=" << d << endl; cout << "x1=" << x1 << endl; cout << "x2=" << x2 << endl; } return 0; }
[ "20321016@students.bfu.bg" ]
20321016@students.bfu.bg
27b5afb048201f0aaa1080ad6346dc409dce900c
7aa50d001d3042a646f0ed72a48005115f0d017e
/SavingsAccountBalance.cpp
b4f1999618cd65ae7955acc7103505a6c4c39ef5
[]
no_license
ashiqislam/CPP-Programs
96e706e80a587f59c3307477cc919ca1bb062e78
a2c7e5fbb826c3cae0083dd41c8b4f8615d0b678
refs/heads/master
2021-08-31T09:08:59.655378
2017-12-20T21:41:07
2017-12-20T21:41:07
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,200
cpp
#include<iostream> using namespace std; int main() { double annInterestRate = 0, startbalance = 0, numberOfMonths = 0, deposit = 0, withdrawal = 0, TotalDeposits = 0, TotalWithdrawals = 0, TotalInterest = 0, monInterestRate = 0, TotalBalance = 0; char loop; do { cout<<"\nEnter the annual interest rate: "; cin>>annInterestRate; cout<<"\nEnter the starting balance: "; cin>>startbalance; cout<<"\nEnter the number of months that have\npassed since the account was established: "; cin>>numberOfMonths; TotalBalance = startbalance; //monthly interest rate monInterestRate = annInterestRate/12; for(int i=1; i<=numberOfMonths; ++i) { cout<<"\nEnter the amount deposited into the account during month "<<i << ": "; cin>>deposit; while(deposit<0) { cout<<"\nEnter a valid amount deposited into the account during month "<<i << ": "; cin>>deposit; } //add deposits to total balance TotalDeposits += deposit; TotalBalance += deposit; cout<<"\nEnter the amount of withdraws during the month " << i << ": "; cin>>withdrawal; while(withdrawal<0) { cout<<"\nEnter a valid amount of withdraws during the month "<< i << ": "; cin>>withdrawal; } //subtract balance with every withdrawal amount TotalWithdrawals += withdrawal; TotalBalance -= withdrawal; //calculate total interest and total balance TotalInterest += (TotalBalance*monInterestRate); TotalBalance += (TotalBalance*monInterestRate); } if(TotalBalance<0) { cout<<"\nSorry, The account has been closed due to negative balance.\n\n"; return 0; } //display results cout<<"\nEnding balance: "<<TotalBalance <<"\nTotal amount of deposit: "<<TotalDeposits <<"\nTotal amount of withdraws: "<<TotalWithdrawals <<"\nTotal interest earned: "<<TotalInterest<<endl; cout << "\nWould you like to restart the program?" << "\nEnter the letter y to restart or any other key to exit: "; cin>>loop; if (loop != 'Y' && loop != 'y') { cout << "Thank you for using this program.\n"; system("pause>nul"); return 0; } }while(loop == 'Y' || 'y'); return 0; } //notes to self: remember to place calculations inside for loop for a program like this
[ "noreply@github.com" ]
noreply@github.com