当前位置: 首页>>代码示例>>C++>>正文


C++ PluginStartupInfo类代码示例

本文整理汇总了C++中PluginStartupInfo的典型用法代码示例。如果您正苦于以下问题:C++ PluginStartupInfo类的具体用法?C++ PluginStartupInfo怎么用?C++ PluginStartupInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了PluginStartupInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Undo

static void Undo()
{

	char *Lines = (char*)StackPop();
	free(Lines);

	EditorUndoRedo eur = {sizeof(EditorUndoRedo), EUR_UNDO};
	Info.EditorControl(-1, ECTL_UNDOREDO, 0, &eur);

	struct EditorSetPosition es = {sizeof(EditorSetPosition)};
	if (--nChanges == 0) {
		if (bLineChanged) {
			es.CurLine = OriginalLine;
			es.TopScreenLine = OriginalLine;
		}
		else {
			es.CurLine = InitialLine;
			es.TopScreenLine = InitialTop;
		}
		es.CurPos = InitialCol;
		es.CurTabPos = es.LeftPos = es.Overtype = -1;
	}
	else {
		es.CurLine = 0;
		es.CurPos = 0;
		es.TopScreenLine = 0;
		es.CurTabPos = es.LeftPos = es.Overtype = -1;
	}
	Info.EditorControl(-1, ECTL_SETPOSITION, 0, &es);
}
开发者ID:iyudincev,项目名称:FilterLines,代码行数:30,代码来源:FilterLines.cpp

示例2: cmd

int		Panel::ProcessEvent(int Event, void *Param) {
	if (Event == FE_COMMAND) {
		PCWSTR cmd((PCWSTR)Param);
		if (cmd) {
			int		argc = 0;
			PWSTR	*argv = ::CommandLineToArgvW(cmd, &argc);
			if (argc > 1 && Eqi(argv[0], L"cd")) {
				try {
					psi.Control(this, FCTL_REDRAWPANEL, 0, nullptr);
					ConnectingToServer(argv[1]);
					winstd::shared_ptr<RemoteConnection> tmp(new RemoteConnection(argv[1]));
					WinTS tts(tmp->host());
					m_ts = tts;
					m_conn.swap(tmp);
					psi.Control(this, FCTL_SETCMDLINE, 0, (LONG_PTR)EMPTY_STR);
					psi.Control(this, FCTL_UPDATEPANEL, 0, nullptr);
					psi.Control(this, FCTL_REDRAWPANEL, 0, nullptr);
				} catch (WinError &e) {
					if (e.code() == ERROR_ACCESS_DENIED) {
						AccesDeniedErrorMessage();
					} else {
						farebox_code(e.code(), e.where().c_str());
					}
				}
			}
			::LocalFree(argv);
			return true;
		}
	}
	return	false;
}
开发者ID:IDA-RE-things,项目名称:andrew-grechkin,代码行数:31,代码来源:panel.cpp

示例3: ProcessSynchroEventW

intptr_t WINAPI ProcessSynchroEventW(const struct ProcessSynchroEventInfo *Info)
{
	if (Info->Event != SE_COMMONSYNCHRO)
		return 0;
	if (gnInCall > 0)
		return 0;
#if 1
	OutputDebugString(L"Posting macro\n");
	MacroSendMacroText mcr = {sizeof(MacroSendMacroText)};
	//mcr.SequenceText = L"i = 0; if APanel.Plugin then i=i+1; end; if PPanel.Plugin then i=i+2; end; Plugin.Call(\"6197AF6C-4755-49A5-84A1-8F227BF4790E\",i)";
	mcr.SequenceText = L"Plugin.Call(\"6197AF6C-4755-49A5-84A1-8F227BF4790E\",APanel.Plugin and \"\" or APanel.Path0,PPanel.Plugin and \"\" or PPanel.Path0)";
	INT_PTR i = psi.MacroControl(&guid_PluginGuid, MCTL_SENDSTRING, MSSC_POST, &mcr);
	MacroParseResult* mpr;
	if (!i)
	{
		mpr = (MacroParseResult*)calloc(4096,1);
		mpr->StructSize = sizeof(*mpr);
		psi.MacroControl(&guid_PluginGuid, MCTL_GETLASTERROR, 4096, mpr);
		free(mpr);
	}
	else
		InterlockedIncrement(&gnInCall);
#endif
#if 0
	wchar_t szDbg[100];
	static LONG nCount; nCount++;
	wsprintf(szDbg, L"%i: PanelControl(FCTL_GETPANELINFO, PANEL_ACTIVE)...", nCount);
	PanelInfo piA = {sizeof(piA)}, piP = {sizeof(piP)};
	INT_PTR nARc = psi.PanelControl(PANEL_ACTIVE, FCTL_GETPANELINFO, 0, &piA);
	OutputDebugString(L" and PANEL_PASSIVE...");
	INT_PTR nPRc = psi.PanelControl(PANEL_PASSIVE, FCTL_GETPANELINFO, 0, &piP);
	OutputDebugString(L" Done\n");
#endif
	return 0;
}
开发者ID:Maximus5,项目名称:FarPlugins,代码行数:35,代码来源:SyncPoll.cpp

示例4: OpenPlace

static void OpenPlace(HANDLE hDlg,BoardParams *DlgParams,int row,int col,CHECK_OPEN_PLACE check)
{
  FarDialogItem DialogItem; int color;
  if(row<0) return;
  if(col<0) return;
  if(row>=DlgParams->width) return;
  if(col>=DlgParams->height) return;
  Info.SendDlgMessage(hDlg,DM_GETDLGITEMSHORT,DlgParams->width*col+row,&DialogItem);
  if(GET_DATA_1(DialogItem)==STATE_CLOSE)
  {
    SET_DATA_1(DialogItem,STATE_OPEN);
    DialogItem.VBuf[1].Char=GetChar(GET_DATA_0(DialogItem),GET_DATA_1(DialogItem),&color);
    int bgcolor=GetBG(row,col,GET_DATA_1(DialogItem));
    DialogItem.VBuf[0].Attributes.ForegroundColor=DialogItem.VBuf[1].Attributes.ForegroundColor=DialogItem.VBuf[2].Attributes.ForegroundColor=color;
    DialogItem.VBuf[0].Attributes.BackgroundColor=DialogItem.VBuf[1].Attributes.BackgroundColor=DialogItem.VBuf[2].Attributes.BackgroundColor=bgcolor;
    Info.SendDlgMessage(hDlg,DM_SETDLGITEMSHORT,DlgParams->width*col+row,&DialogItem);
    if(!GET_DATA_0(DialogItem))
    {
      OpenPlace(hDlg,DlgParams,row-1,col-1,COP_NONE);
      OpenPlace(hDlg,DlgParams,row-1,col,COP_NONE);
      OpenPlace(hDlg,DlgParams,row-1,col+1,COP_NONE);
      OpenPlace(hDlg,DlgParams,row,col-1,COP_NONE);
      OpenPlace(hDlg,DlgParams,row,col+1,COP_NONE);
      OpenPlace(hDlg,DlgParams,row+1,col-1,COP_NONE);
      OpenPlace(hDlg,DlgParams,row+1,col,COP_NONE);
      OpenPlace(hDlg,DlgParams,row+1,col+1,COP_NONE);
    }
    if(check!=COP_NONE) CheckStop(hDlg,DlgParams,row,col);
  }
  else if(check==COP_CHECK_ALL&&GET_DATA_1(DialogItem)==STATE_OPEN&&GET_DATA_0(DialogItem)>0&&GET_DATA_0(DialogItem)<9)
  {
    int mines=0;
    mines+=GetMine(row-1,col-1,hDlg,DlgParams,true);
    mines+=GetMine(row-1,col,hDlg,DlgParams,true);
    mines+=GetMine(row-1,col+1,hDlg,DlgParams,true);
    mines+=GetMine(row,col-1,hDlg,DlgParams,true);
    mines+=GetMine(row,col+1,hDlg,DlgParams,true);
    mines+=GetMine(row+1,col-1,hDlg,DlgParams,true);
    mines+=GetMine(row+1,col,hDlg,DlgParams,true);
    mines+=GetMine(row+1,col+1,hDlg,DlgParams,true);
    if(mines==GET_DATA_0(DialogItem)) //FIXME
    {
      OpenPlace(hDlg,DlgParams,row-1,col-1,COP_CHECK_STOP);
      OpenPlace(hDlg,DlgParams,row-1,col,COP_CHECK_STOP);
      OpenPlace(hDlg,DlgParams,row-1,col+1,COP_CHECK_STOP);
      OpenPlace(hDlg,DlgParams,row,col-1,COP_CHECK_STOP);
      OpenPlace(hDlg,DlgParams,row,col+1,COP_CHECK_STOP);
      OpenPlace(hDlg,DlgParams,row+1,col-1,COP_CHECK_STOP);
      OpenPlace(hDlg,DlgParams,row+1,col,COP_CHECK_STOP);
      OpenPlace(hDlg,DlgParams,row+1,col+1,COP_CHECK_STOP);

      CheckStop(hDlg,DlgParams,row,col);
    }
  }
}
开发者ID:Maximus5,项目名称:evil-programmers,代码行数:55,代码来源:farmine.cpp

示例5: SetFocusUser

static void SetFocusUser(HANDLE hDlg,BoardParams *DlgParams,bool real)
{
  if(real)
    Info.SendDlgMessage(hDlg,DM_SETFOCUS,DlgParams->width*DlgParams->curr_col+DlgParams->curr_row,0);
  else
  {
    int curr_elem=(int)Info.SendDlgMessage(hDlg,DM_GETFOCUS,0,0);
    DlgParams->curr_row=curr_elem%DlgParams->width;
    DlgParams->curr_col=curr_elem/DlgParams->width;
  }
  RedrawPlace(hDlg,DlgParams,true);
}
开发者ID:Maximus5,项目名称:evil-programmers,代码行数:12,代码来源:farmine.cpp

示例6: HighlightLine

static void HighlightLine(intptr_t nLine)
{
	EditorInfo einfo = {sizeof(EditorInfo)};
	Info.EditorControl(-1, ECTL_GETINFO, 0, &einfo);

	EditorSelect sel = {sizeof(EditorSelect)};
	sel.BlockHeight=1;
	sel.BlockStartLine=nLine;
	sel.BlockStartPos=0;
	sel.BlockType=BTYPE_STREAM;
	sel.BlockWidth=einfo.WindowSizeX;
	Info.EditorControl(-1, ECTL_SELECT, 0, &sel);
}
开发者ID:iyudincev,项目名称:FilterLines,代码行数:13,代码来源:FilterLines.cpp

示例7: OpenW

HANDLE WINAPI OpenW(const OpenInfo *OInfo)
{
	static FarDialogItem DlgItems[]={
		/* 0*/  {DI_DOUBLEBOX,2, 1,37, 5, {0},NULL      ,NULL      ,0                                ,GetMsg(MTitle)},
		/* 1*/  {DI_EDIT     ,4, 2,34, 2, {1},PluginName,NULL      ,DIF_HISTORY                      ,L""},
		/* 2*/  {DI_CHECKBOX ,4, 3, 0, 0, {0},0         ,NULL      ,0                                ,GetMsg(MCase)},
		/* 3*/  {DI_BUTTON   ,0, 4, 0, 0, {0},0         ,NULL      ,DIF_CENTERGROUP|DIF_DEFAULTBUTTON,GetMsg(MOk)},
		/* 4*/  {DI_BUTTON   ,0, 4, 0, 0, {0},0         ,NULL      ,DIF_CENTERGROUP                  ,GetMsg(MCancel)}
	};

	CFarSettings settings(PluginId);
	bPrevCaseSensitive = settings.Get(L"CaseSensitive", false);
	DlgItems[ixCaseSensitive].Selected = bPrevCaseSensitive ? 1 : 0;
	HANDLE hEdit = Info.DialogInit(&PluginId, &DialogId,
		-1, -1, 40, 7,
		PluginName,
		DlgItems, ArraySize(DlgItems),
		0, 0,
		MyDlgProc, 0);
	if (hEdit == INVALID_HANDLE_VALUE)
		return INVALID_HANDLE_VALUE;

	EditorInfo einfo = {sizeof(EditorInfo)};
	Info.EditorControl(-1, ECTL_GETINFO, 0, &einfo);
	InitialLine = einfo.CurLine;
	InitialCol = einfo.CurPos;
	InitialTop = einfo.TopScreenLine;
	TotalLines = einfo.TotalLines;

	nChanges = 0;
	bSequentialInput = true;
	bLineChanged = false;
	ctx = SearchAlloc();

	if (Info.DialogRun(hEdit)!=ixOk)
		UndoAll();

	RemoveHighlight();

	settings.Set(L"CaseSensitive", bPrevCaseSensitive);

	Info.DialogFree(hEdit);
	if (Length(PrevPattern)<MAX_PATTERN_LEN)
		SearchFree(ctx);
	else
		SearchHFree(ctx);
	SetLength(&PrevPattern,0);

	return INVALID_HANDLE_VALUE;
}
开发者ID:iyudincev,项目名称:FilterLines,代码行数:50,代码来源:FilterLines.cpp

示例8: FarErrorHandler

static void FarErrorHandler(const wchar_t* s)
{
	const wchar_t* items[]={ L"Framework Error", s, L"OK", L"Debug" };
	if (Info.Message(&MainGuid, &MainGuid, FMSG_WARNING, NULL, items, 4, 2) == 1) {
		DebugBreak();
	}
}
开发者ID:starcat13,项目名称:FileCopyEx,代码行数:7,代码来源:FileCopyEx.cpp

示例9: RunKey

static void RunKey(const wchar_t* Key)
{
  MacroSendMacroText macro;
  memset(&macro,0,sizeof(macro));
  macro.StructSize=sizeof(MacroSendMacroText);
  macro.SequenceText=Key;
  Info.MacroControl(&MainGuid,MCTL_SENDSTRING,MSSC_POST,&macro);
}
开发者ID:Maximus5,项目名称:evil-programmers,代码行数:8,代码来源:farmine.cpp

示例10: PollingThread

DWORD WINAPI PollingThread(LPVOID lpThreadParameter)
{
	while (WaitForSingleObject(hExit, 100))
	{
		psi.AdvControl(&guid_PluginGuid, ACTL_SYNCHRO, 0, NULL);
	}
	return 0;
}
开发者ID:Maximus5,项目名称:FarPlugins,代码行数:8,代码来源:SyncPoll.cpp

示例11: ScrollText

static void ScrollText(ScrollType st)
{
	EditorInfo einfo = {sizeof(EditorInfo)};
	EditorSetPosition es = {sizeof(EditorSetPosition)};

	Info.EditorControl(-1, ECTL_GETINFO, 0, &einfo);
	switch (st) {
	case stDn:
		es.CurLine = einfo.CurLine+1;
		break;
	case stUp:
		es.CurLine = einfo.CurLine-1;
		break;
	case stPgDn:
		es.CurLine = einfo.CurLine+einfo.WindowSizeY-1;
		es.TopScreenLine = einfo.TopScreenLine+einfo.WindowSizeY-1;
		break;
	case stPgUp:
		es.CurLine = einfo.CurLine-einfo.WindowSizeY+1;
		es.TopScreenLine = einfo.TopScreenLine-einfo.WindowSizeY+1;
		break;
	case stEnd:
		es.CurLine = /*es.TopScreenLine = */einfo.TotalLines-1;
		break;
	default:
		es.CurLine = /*es.TopScreenLine = */0;
		break;
	}
	bLineChanged = true;

	es.CurPos = -1;
	es.CurTabPos = es.LeftPos = es.Overtype = -1;
	Info.EditorControl(-1, ECTL_SETPOSITION, 0, &es);

	//обновим № исходной строки
	Info.EditorControl(-1, ECTL_GETINFO, 0, &einfo);
	char *Lines = (char*)StackPeek();
	OriginalLine = CalcOriginalLine(einfo.CurLine);
	HighlightLine(einfo.CurLine);

	Info.AdvControl(&PluginId, ACTL_REDRAWALL, 0, NULL);
}
开发者ID:iyudincev,项目名称:FilterLines,代码行数:42,代码来源:FilterLines.cpp

示例12: RedrawPlace

static void RedrawPlace(HANDLE hDlg,BoardParams *DlgParams,bool focused)
{
  int color;
  FarDialogItem DialogItem;
  Info.SendDlgMessage(hDlg,DM_GETDLGITEMSHORT,DlgParams->width*DlgParams->curr_col+DlgParams->curr_row,&DialogItem);
  DialogItem.VBuf[1].Char=GetChar(GET_DATA_0(DialogItem),GET_DATA_1(DialogItem),&color);
  if(focused&&color==(FOREGROUND_RED|FOREGROUND_INTENSITY)) color=0;
  int bgcolor=focused?(FOREGROUND_RED|FOREGROUND_INTENSITY):(GetBG(DlgParams->curr_row,DlgParams->curr_col,GET_DATA_1(DialogItem)));
  DialogItem.VBuf[0].Attributes.ForegroundColor=DialogItem.VBuf[1].Attributes.ForegroundColor=DialogItem.VBuf[2].Attributes.ForegroundColor=color;
  DialogItem.VBuf[0].Attributes.BackgroundColor=DialogItem.VBuf[1].Attributes.BackgroundColor=DialogItem.VBuf[2].Attributes.BackgroundColor=bgcolor;
}
开发者ID:Maximus5,项目名称:evil-programmers,代码行数:11,代码来源:farmine.cpp

示例13: OpenW

HANDLE WINAPI OpenW(const struct OpenInfo*)
{
  InitDialogItem InitItems[]=
  {
    //type,x1,y1,x2,y2,focus,selected,flags,default,data
    {DI_DOUBLEBOX,3,1,67,18,0,0,0,0,_T("Very Cool Dialog")},
    {DI_USERCONTROL,4,2,66,17,0,0,0,0,_T("")},
    {DI_BUTTON,3,19,0,0,0,0,0,1,_T("Ok")},
    {DI_BUTTON,12,19,0,0,0,0,0,0,_T("Cancel")},
  };
  FarDialogItem DialogItems[sizeof(InitItems)/sizeof(InitItems[0])];
  InitDialogItems(InitItems,DialogItems,sizeof(InitItems)/sizeof(InitItems[0]));
  FAR_CHAR_INFO *VirtualBuffer=(FAR_CHAR_INFO *)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,(DialogItems[1].X2-DialogItems[1].X1+1)*(DialogItems[1].Y2-DialogItems[1].Y1+1)*sizeof(FAR_CHAR_INFO));
  DialogItems[1].VBuf=VirtualBuffer;
  HANDLE hDlg=Info.DialogInit(&MainGuid,&DialogGuid,-1,-1,71,21,NULL,DialogItems,sizeof(DialogItems)/sizeof(DialogItems[0]),0,0,MainDialogProc,0);
  if(hDlg!=INVALID_HANDLE_VALUE)
  {
    Info.DialogRun(hDlg);
    Info.DialogFree(hDlg);
  }
  if(VirtualBuffer) HeapFree(GetProcessHeap(),0,VirtualBuffer);
  return NULL;
}
开发者ID:Maximus5,项目名称:evil-programmers,代码行数:23,代码来源:test.cpp

示例14: OpenW

/**
  Open plugin configuration of actions dialog.
*/
HANDLE WINAPI OpenW(const struct OpenInfo *oInfo)
{
  switch (oInfo->OpenFrom) {
    case OPEN_EDITOR:
      editorSet->openMenu();
      break;
    case OPEN_COMMANDLINE:
      {
		OpenCommandLineInfo *ocli =(OpenCommandLineInfo*)oInfo->Data;
        //file name, which we received
        const wchar_t *file = ocli->CommandLine;

        wchar_t *nfile = PathToFull(file,true);
        if (nfile){
          if (!editorSet){
            editorSet = new FarEditorSet();
          }
          editorSet->viewFile(DString(nfile));
        }

        delete[] nfile;
      }
      break;
    case OPEN_FROMMACRO:
      {
        Info.MacroControl(&MainGuid, MCTL_GETAREA, 0, NULL);
        OpenMacroInfo* mi=(OpenMacroInfo*)oInfo->Data;
        int MenuCode=-1;
        if (mi->Count)
        {
          switch (mi->Values[0].Type) {
          case FMVT_INTEGER: MenuCode=(int)mi->Values[0].Integer; break;
          case FMVT_DOUBLE: MenuCode=(int)mi->Values[0].Double; break;
          default: MenuCode = -1;
          }
        }

        if (MenuCode < 0)
          return 0;
        editorSet->openMenu(MenuCode-1);
      }
      break;
  }
  return 0;
};
开发者ID:MarsBlessed,项目名称:FarColorer,代码行数:48,代码来源:pcolorer.cpp

示例15: GetMine

static int GetMine(int row,int col,HANDLE hDlg,BoardParams *DlgParams,bool flagged)
{
  if(row<0) return 0;
  if(col<0) return 0;
  if(row>=DlgParams->width) return 0;
  if(col>=DlgParams->height) return 0;
  FarDialogItem DialogItem;
  Info.SendDlgMessage(hDlg,DM_GETDLGITEMSHORT,col*DlgParams->width+row,&DialogItem);
  if(flagged)
  {
    if(GET_DATA_1(DialogItem)==STATE_MARKED) return 1;
  }
  else
  {
    if(GET_DATA_0(DialogItem)==9) return 1;
  }
  return 0;
}
开发者ID:Maximus5,项目名称:evil-programmers,代码行数:18,代码来源:farmine.cpp


注:本文中的PluginStartupInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。