Esempio n. 1
0
void
nsCounterList::RecalcAll()
{
    mDirty = false;

    nsCounterNode *node = First();
    if (!node)
        return;

    do {
        SetScope(node);
        node->Calc(this);

        if (node->mType == nsCounterNode::USE) {
            nsCounterUseNode *useNode = node->UseNode();
            // Null-check mText, since if the frame constructor isn't
            // batching, we could end up here while the node is being
            // constructed.
            if (useNode->mText) {
                nsAutoString text;
                useNode->GetText(text);
                useNode->mText->SetData(text);
            }
        }
    } while ((node = Next(node)) != First());
}
NS_IMETHODIMP
HTMLTableCellElement::SetScope(const nsAString& aScope)
{
  ErrorResult rv;
  SetScope(aScope, rv);
  return rv.ErrorCode();
}
Esempio n. 3
0
/************************************************************************
*  技初始化函数
************************************************************************/
bool Entity::init()
{
	m_pSprite = Sprite::create();

	// 初始化血条
	m_pBloodProgress =  ProgressView::create();
	m_pBloodProgress->InitProgress("RPG_Resource/ui/blood_box.png","RPG_Resource/ui/blood_in.png",1.0);
	m_pBloodProgress->setScale(0.2);
	m_pBloodProgress->setPosition(6,90);
	this->addChild(m_pBloodProgress);

	// 初始化被选中时显示的光圈
	m_pCircleLight =Sprite::create("RPG_Resource/ui/tray_self.png");

	m_pCircleLight->setScale(0.6);
	m_pCircleLight->setPosition(10,-20);

	this->addChild(m_pCircleLight);
	this->addChild(m_pSprite);

	m_pCircleLight->setVisible(false);

	// 设置默认的领地
	SetScope(128,128);

	return true;
}
void PHPEntityFunctionAlias::FromResultSet(wxSQLite3ResultSet& res)
{
    SetDbId(res.GetInt("ID"));
    SetShortName(res.GetString("NAME"));
    SetRealname(res.GetString("REALNAME"));
    SetLine(res.GetInt("LINE_NUMBER"));
    SetFilename(res.GetString("FILE_NAME"));
    SetFullName(res.GetString("FULLNAME"));
    SetScope(res.GetString("SCOPE"));
}
Esempio n. 5
0
int ScheduleAgentOperations(struct Bundle *bp)

{ struct SubType *sp;
  struct Promise *pp;
  enum typesequence type;
  int pass;

if (PROCESSREFRESH == NULL || (PROCESSREFRESH && IsRegexItemIn(PROCESSREFRESH,bp->name)))
   {
   DeleteItemList(PROCESSTABLE);
   PROCESSTABLE = NULL;
   }

for (pass = 1; pass < CF_DONEPASSES; pass++)
   {
   for (type = 0; TYPESEQUENCE[type] != NULL; type++)
      {
      ClassBanner(type);

      if ((sp = GetSubTypeForBundle(TYPESEQUENCE[type],bp)) == NULL)
         {
         continue;      
         }

      BannerSubType(bp->name,sp->name,pass);
      SetScope(bp->name);

      if (!NewTypeContext(type))
         {
         continue;
         }

      for (pp = sp->promiselist; pp != NULL; pp=pp->next)
         {
         SaveClassEnvironment();

         ExpandPromise(cf_agent,bp->name,pp,KeepAgentPromise);

         if (Abort())
            {
            NoteClassUsage(VADDCLASSES);
            DeleteTypeContext(type);
            return false;
            }
         }

      DeleteTypeContext(type);      
      }
   }

NoteClassUsage(VADDCLASSES);

return true;
}
Esempio n. 6
0
/************************************************************************
*  初始化
************************************************************************/
bool Skill::init()
{
	if (!Entity::init())
	{
		return false;
	}
	SetDamageValue(10);
	m_pBloodProgress->setVisible(false);
	SetScope(256,256);
	m_nLevel = 0;
	m_fConsumeMagic = 0;
	Upgrade();
	return true;
}
Esempio n. 7
0
static void KeepPromiseBundles()
{
    Bundle *bp;
    SubType *sp;
    Promise *pp;
    char *scope;

/* Dial up the generic promise expansion with a callback */

    for (bp = BUNDLES; bp != NULL; bp = bp->next)       /* get schedule */
    {
        scope = bp->name;
        SetNewScope(bp->name);

        if ((strcmp(bp->type, CF_AGENTTYPES[cf_server]) == 0) || (strcmp(bp->type, CF_AGENTTYPES[cf_common]) == 0))
        {
            DeletePrivateClassContext();        // Each time we change bundle

            BannerBundle(bp, NULL);
            scope = bp->name;

            for (sp = bp->subtypes; sp != NULL; sp = sp->next)  /* get schedule */
            {
                if (strcmp(sp->name, "access") != 0 && strcmp(sp->name, "roles") != 0)
                {
                    continue;
                }

                BannerSubType(scope, sp->name, 0);
                SetScope(scope);
                AugmentScope(scope, NULL, NULL);

                for (pp = sp->promiselist; pp != NULL; pp = pp->next)
                {
                    ExpandPromise(cf_server, scope, pp, KeepServerPromise);
                }
            }
        }
    }
}
void TagEntry::Create(const wxString& fileName,
                      const wxString& name,
                      int lineNumber,
                      const wxString& pattern,
                      const wxString& kind,
                      std::map<wxString, wxString>& extFields)
{
    m_isCommentForamtted = false;
    m_flags = 0;
    m_isClangTag = false;
    SetName(name);
    SetLine(lineNumber);
    SetKind(kind.IsEmpty() ? wxT("<unknown>") : kind);
    SetPattern(pattern);
    SetFile(fileName);
    SetId(-1);
    m_extFields = extFields;
    wxString path;

    // Check if we can get full name (including path)
    path = GetExtField(wxT("class"));
    if(!path.IsEmpty()) {
        UpdatePath(path);
    } else {
        path = GetExtField(wxT("struct"));
        if(!path.IsEmpty()) {
            UpdatePath(path);
        } else {
            path = GetExtField(wxT("namespace"));
            if(!path.IsEmpty()) {
                UpdatePath(path);
            } else {
                path = GetExtField(wxT("interface"));
                if(!path.IsEmpty()) {
                    UpdatePath(path);
                } else {
                    path = GetExtField(wxT("enum"));
                    if(!path.IsEmpty()) {
                        UpdatePath(path);
                    } else {
                        path = GetExtField(wxT("union"));
                        wxString tmpname = path.AfterLast(wxT(':'));
                        if(!path.IsEmpty()) {
                            if(!tmpname.StartsWith(wxT("__anon"))) {
                                UpdatePath(path);
                            } else {
                                // anonymouse union, remove the anonymous part from its name
                                path = path.BeforeLast(wxT(':'));
                                path = path.BeforeLast(wxT(':'));
                                UpdatePath(path);
                            }
                        }
                    }
                }
            }
        }
    }

    if(!path.IsEmpty()) {
        SetScope(path);
    } else {
        SetScope(wxT("<global>"));
    }

    // If there is no path, path is set to name
    if(GetPath().IsEmpty()) SetPath(GetName());

    // Get the parent name
    StringTokenizer tok(GetPath(), wxT("::"));
    wxString parent;

    (tok.Count() < 2) ? parent = wxT("<global>") : parent = tok[tok.Count() - 2];
    SetParent(parent);
}
Esempio n. 9
0
int ScheduleAgentOperations(Bundle *bp, const ReportContext *report_context)
// NB - this function can be called recursively through "methods"
{
    SubType *sp;
    enum typesequence type;
    int pass;
    int save_pr_kept = PR_KEPT;
    int save_pr_repaired = PR_REPAIRED;
    int save_pr_notkept = PR_NOTKEPT;

    if (PROCESSREFRESH == NULL || (PROCESSREFRESH && IsRegexItemIn(PROCESSREFRESH, bp->name)))
    {
        DeleteItemList(PROCESSTABLE);
        PROCESSTABLE = NULL;
    }

    for (pass = 1; pass < CF_DONEPASSES; pass++)
    {
        for (type = 0; AGENT_TYPESEQUENCE[type] != NULL; type++)
        {
            ClassBanner(type);

            if ((sp = BundleGetSubType(bp, AGENT_TYPESEQUENCE[type])) == NULL)
            {
                continue;
            }

            BannerSubType(bp->name, sp->name, pass);
            SetScope(bp->name);

            if (!NewTypeContext(type))
            {
                continue;
            }

            for (size_t ppi = 0; ppi < SeqLength(sp->promises); ppi++)
            {
                Promise *pp = SeqAt(sp->promises, ppi);

                if (ALLCLASSESREPORT)
                {
                    SaveClassEnvironment();
                }

                if (pass == 1)  // Count the number of promises modelled for efficiency
                {
                    CF_TOPICS++;
                }

                ExpandPromise(AGENT_TYPE_AGENT, bp->name, pp, KeepAgentPromise, report_context);

                if (Abort())
                {
                    NoteClassUsage(VADDCLASSES, false);
                    DeleteTypeContext(bp->parent_policy, type, report_context);
                    NoteBundleCompliance(bp, save_pr_kept, save_pr_repaired, save_pr_notkept);
                    return false;
                }
            }

            DeleteTypeContext(bp->parent_policy, type, report_context);
        }
    }

    NoteClassUsage(VADDCLASSES, false);
    return NoteBundleCompliance(bp, save_pr_kept, save_pr_repaired, save_pr_notkept);
}
Esempio n. 10
0
void TagEntry::Create(const wxString &fileName,
                      const wxString &name,
                      int lineNumber,
                      const wxString &pattern,
                      const wxString &kind,
                      std::map<wxString, wxString>& extFields)
{
    SetPosition( wxNOT_FOUND );
    SetName( name );
    SetLine( lineNumber );
    SetKind( kind.IsEmpty() ? wxT("<unknown>") : kind );
    SetPattern( pattern );
    SetFile( fileName );
    SetId(-1);
    SetParentId(-1);

    m_extFields = extFields;
    wxString path;

    // Check if we can get full name (including path)
    path = GetExtField(wxT("class"));
    if(!path.IsEmpty()) {
        UpdatePath( path ) ;
    } else {
        path = GetExtField(wxT("struct"));
        if(!path.IsEmpty()) {
            UpdatePath( path ) ;
        } else {
            path = GetExtField(wxT("namespace"));
            if(!path.IsEmpty()) {
                UpdatePath( path ) ;
            } else {
                path = GetExtField(wxT("interface"));
                if(!path.IsEmpty()) {
                    UpdatePath( path ) ;
                } else {
                    path = GetExtField(wxT("enum"));
                    if(!path.IsEmpty()) {
                        UpdatePath( path ) ;
                    } else {
                        path = GetExtField(wxT("union"));
                        if(!path.IsEmpty()) {
                            UpdatePath( path ) ;
                        }
                    }
                }
            }
        }
    }

    if(!path.IsEmpty()) {
        SetScope(path);
    } else {
        SetScope(wxT("<global>"));
    }

    // If there is no path, path is set to name
    if( GetPath().IsEmpty() )
        SetPath( GetName() );

    // Get the parent name
    StringTokenizer tok(GetPath(), wxT("::"));
    wxString parent;

    (tok.Count() < 2) ? parent = wxT("<global>") : parent = tok[tok.Count()-2];
    SetParent(parent);
}
Esempio n. 11
0
LRESULT CALLBACK StackProc(HWND hwnd, UINT iMessage, WPARAM wParam,
    LPARAM lParam)
{
    LV_ITEM item;
    LV_COLUMN lvC;    
    RECT r;
    LPNMHDR nmh;
    char module[256];
    SCOPE *sl;
    int i, lines;
    switch (iMessage)
    {
        case WM_CTLCOLORSTATIC:
            return (HBRUSH)(COLOR_WINDOW + 1);
        case WM_TIMER:
            KillTimer(hwnd, 100);
            ListView_SetItemState(hwndLV, curSel, 0, LVIS_SELECTED);
            break;
        case WM_NOTIFY:
            nmh = (LPNMHDR)lParam;
            if (nmh->code == NM_SETFOCUS)
            {
                PostMessage(hwndFrame, WM_REDRAWTOOLBAR, 0, 0);
                SendMessage(GetParent(hwnd), WM_ACTIVATEME, 0, 0);
            }
            else if (nmh->code == LVN_GETDISPINFO)
            {
                LV_DISPINFO *p = (LV_DISPINFO *)lParam;
                SCOPE *x = (SCOPE *)p->item.lParam;
                char addr[256];
                p->item.mask |= LVIF_TEXT | LVIF_DI_SETITEM;
                p->item.mask &= ~LVIF_STATE;
                if (p->item.iSubItem == 2)
                {
                    p->item.pszText = x->name;
                }
                else
                {
                    sprintf(addr,"%8X", x->address);
                    p->item.pszText = addr;
                }
            }
            else if (nmh->code == LVN_ITEMCHANGED)
            {
                LPNMLISTVIEW p = (LPNMHDR)lParam;
                if (p->uChanged & LVIF_STATE)
                {
                    if (p->uNewState & LVIS_SELECTED)
                    {
                        i = 0;
                        PostMessage(hwnd, WM_USER, p->iItem, 0);
                        SetTimer(hwnd, 100, 400, 0);
                    }
                }
            }
            else if (nmh->code == LVN_KEYDOWN)
            {
                switch (((LPNMLVKEYDOWN)lParam)->wVKey)
                {
                    case 'C':
                        if (GetKeyState(VK_CONTROL) &0x80000000)
                        {
                            CopyText(hwnd);
                        }
                        break;
                    case VK_UP:
                        if (curSel > 0)
                            SendMessage(hwnd, WM_USER, curSel-1, 0);
                        break;
                    case VK_DOWN:
                        if (curSel < ListView_GetItemCount(hwndLV) - 1)
                            SendMessage(hwnd, WM_USER, curSel + 1, 0);
                        break;
                }
            }
            break;
        case WM_COMMAND:
            switch(LOWORD(wParam))
            {
                case ID_TBPROCEDURE:
                    if (HIWORD(wParam) == CBN_SELENDOK)
                    {
                        int i = SendMessage(hwndTbProcedure, CB_GETCURSEL, 0 , 0);
                        if (i != CB_ERR)
                        {
                            SendMessage(hwnd, WM_USER, i, 0);
                        }
                    }
                    break;
            }
            break;
        case WM_USER:
        {
            memset(&item, 0, sizeof(item));
            if (curSel != 0)
            {
                item.iItem = curSel;
                item.iSubItem = 0;
                item.mask = LVIF_IMAGE;
                item.iImage = IML_BLANK;
                ListView_SetItem(hwndLV, &item);
            }

            curSel = wParam;
            if (curSel != 0)
            {
                item.iItem = curSel;
                item.mask = LVIF_IMAGE;
                item.iImage = IML_CONTINUATION;
                ListView_SetItem(hwndLV, &item);
            }
            sl = StackList;
            lines = curSel;
            while (sl && lines)
            {
                sl = sl->next;
                lines--;
            }
            if (sl)
            {
                if (GetBreakpointLine(sl->address, module, &lines, curSel != 0))
                {
                    char *p;
                    static DWINFO x;
                    strcpy(x.dwName, sl->fileName);
                    p = strrchr(module, '\\');
                    if (p)
                        strcpy(x.dwTitle, p + 1);
                    else
                        strcpy(x.dwTitle, module);
                    x.dwLineNo = sl->lineno;
                    x.logMRU = FALSE;
                    x.newFile = FALSE;
                    SetScope(sl);
                    CreateDrawWindow(&x, TRUE);
                }
            }
        }
            break;
        case WM_CREATE:
            hwndStack = hwnd;
            GetClientRect(hwnd, &r);
            hwndLV = CreateWindowEx(0, WC_LISTVIEW, "", 
                           LVS_REPORT | LVS_SINGLESEL | WS_CHILD | WS_VISIBLE | WS_BORDER,
                           0,0,r.right-r.left, r.bottom - r.top, hwnd, 0, hInstance, 0);
            ListView_SetExtendedListViewStyle(hwndLV, LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);
            StackFont = CreateFontIndirect(&fontdata);
            SendMessage(hwndLV, WM_SETFONT, (WPARAM)StackFont, 0);
            lvC.mask = LVCF_WIDTH | LVCF_SUBITEM ;
            lvC.cx = 20;
            lvC.iSubItem = 0;
            ListView_InsertColumn(hwndLV, 0, &lvC);
            lvC.mask = LVCF_WIDTH | LVCF_SUBITEM | LVCF_TEXT;
            lvC.cx = 80;
            lvC.iSubItem = 1;
            lvC.pszText = "Address";
            ListView_InsertColumn(hwndLV, 1, &lvC);
            lvC.mask = LVCF_WIDTH | LVCF_SUBITEM | LVCF_TEXT;
            lvC.cx = 200;
            lvC.iSubItem = 2;
            lvC.pszText = "Location";
            ListView_InsertColumn(hwndLV, 2, &lvC);
            ListView_SetImageList(hwndLV, tagImageList, LVSIL_SMALL);
            break;
        case WM_SIZE:
            r.left = r.top = 0;
            r.right = LOWORD(lParam);
            r.bottom = HIWORD(lParam);
            MoveWindow(hwndLV, r.left, r.top, r.right - r.left,
                r.bottom - r.top, 1);
            break;
            // fall through
        case WM_RESTACK:
            SetScope(NULL);
            ClearStackArea(hwnd);
            EnableWindow(hwndLV, uState != notDebugging && wParam);
            EnableWindow(hwndTbProcedure, uState != notDebugging && wParam);
            if (uState != notDebugging && wParam)
            {
                int i = 0;
                char buf[256];
                SCOPE *list;
                SetStackArea(hwnd);
                
                list = StackList;
                ListView_DeleteAllItems(hwndLV);
                memset(&item, 0, sizeof(item));
                SendMessage(hwndTbProcedure, CB_RESETCONTENT, 0, 0);
                while (list)
                {

                    item.iItem = i;
                    item.iSubItem = 0;
                    item.mask = LVIF_IMAGE | LVIF_PARAM;
                    if (i == 0)
                    {
                        if (activeThread == stoppedThread)
                            item.iImage = IML_STOPBP;
                        else
                            item.iImage = IML_STOP;
                        if (i == curSel)
                            SetScope(list);
                            
                    }
                    else if (i == curSel)
                    {
                        item.iImage = IML_CONTINUATION;
                        SetScope(list);
                    }
                    else
                    {
                        item.iImage = IML_BLANK;
                    }
                    item.lParam = (LPARAM)list;
                    ListView_InsertItem(hwndLV, &item);
                    
                    item.iSubItem = 1;
                    item.mask = LVIF_PARAM | LVIF_TEXT;
                    item.lParam = (LPARAM)list;
                    item.pszText = "";
                    ListView_InsertItem(hwndLV, &item);
                    i++;
                    sprintf(buf, "%08x %s", list->address, list->name);
                    SendMessage(hwndTbProcedure, CB_ADDSTRING, 0, (LPARAM)buf);
                    list = list->next;
                }
                SendMessage(hwndTbProcedure, CB_SETCURSEL, curSel, 0);
            }
            break;
        case WM_DESTROY:
            ClearStackArea(hwnd);
            hwndStack = 0;
            DeleteObject(StackFont);
            break;
        case WM_SETFOCUS:
            SendMessage(GetParent(hwnd), WM_ACTIVATEME, 0, 0);
            break;
        case WM_KILLFOCUS:
            break;
    }
    return DefWindowProc(hwnd, iMessage, wParam, lParam);
}
Esempio n. 12
0
File: scope.c Progetto: frerich/core
void SetNewScope(char *id)
{
    NewScope(id);
    SetScope(id);
}