Beispiel #1
0
/**
	@brief	外部のウインドウにaceの機能で描画を行う。
*/
void EmptyExternal()
{
	InitWindow();

	// aceを初期化する。
#if _WIN32
	asd::Engine::InitializeByExternalWindow(g_handle, nullptr, 640, 480, asd::EngineOption());
#else
	asd::Engine::InitializeByExternalWindow((void*)(g_display), (void*)(&g_window), 640, 480, asd::EngineOption());
#endif

	// aceが進行可能かチェックする。 
	while (asd::Engine::DoEvents())
	{
		if (!DoEvent()) break;

		// aceを更新する。
		asd::Engine::Update();
	}

	// aceを終了する。
	asd::Engine::Terminate();

	ExitWindow();
}
Beispiel #2
0
//----------------------------------------------------------------------------------
//
//----------------------------------------------------------------------------------
void TermGraphics()
{
	g_renderer->Destory();
	ES_SAFE_RELEASE( g_d3d_device );
	ES_SAFE_RELEASE( g_d3d );

	ExitWindow();
}
Beispiel #3
0
sortGroup::sortGroup(FunctionsGroup &object, QWidget *parent)
	: QDialog(parent)
{
	ui.setupUi(this);
	localObj = &object;
	showListGroups();
	connect(ui.sortGroupUp, SIGNAL(clicked()),this,SLOT(getUpItem()));
	connect(ui.sortGroupDown, SIGNAL(clicked()),this,SLOT(getDownItem()));
	connect(ui.sortGroupExit, SIGNAL(clicked()),this,SLOT(ExitWindow()));
}
//----------------------------------------------------------------------------------
//
//----------------------------------------------------------------------------------
void TermGraphics()
{
	g_renderer->Destory();
	ES_SAFE_RELEASE( g_renderTargetView );
	ES_SAFE_RELEASE( g_backBuffer );
	ES_SAFE_RELEASE( g_depthStencilView );
	ES_SAFE_RELEASE( g_depthBuffer );
	ES_SAFE_RELEASE( g_swapChain );
	ES_SAFE_RELEASE( g_dxgiFactory );
	ES_SAFE_RELEASE( g_adapter );
	ES_SAFE_RELEASE( g_dxgiDevice );
	ES_SAFE_RELEASE( g_context );
	ES_SAFE_RELEASE( g_device );

	ExitWindow();
}
Beispiel #5
0
/* Display the submenu pointed to by the passed show: menu item. */
void ShowSubMenu (Menu_Item_Type *i) {
  int c;
  Menu_Type *m;

  /* find matching menu, if any */
  if ((m=LookupMenu(i->command)) != NULL) {
    /* got match -- show it and handle input for it. */
    AddWindow(m);
    DrawAll();
    do {
      c=DoMenu(m,Pdmenu_Action,Handle_Ctrl_C);
      if ((c==QUIT_EXIT) || (c==Q_KEY_EXIT))
        ExitWindow();
    } while (c==0);
  }
}
Beispiel #6
0
/* 
 * Run a command, and display its output in a window.
 * If truncate==1, the output will not be wrapped.
 * This function is a horrible mess and I hope to do away with it one day.
 */
void RunShow (char *title, char *command, int truncate) {
  FILE *pcommand;
  char *realstr=NULL,*str=NULL;
  int i=0,j,k;

  /* Display wait text. */
  DrawBase(_("Please wait..."));
  SLsmg_refresh();

  /* allocate memory for the window */
  menus->next=malloc(sizeof(Menu_Type));
  menus->next->last=menus;
  menus->next->next=NULL;
  menus=menus->next;

  /* load up the menu with the appropriate values */
  menus->title=malloc(strlen(title)+1);
  strcpy(menus->title,title);
  menus->helptext=malloc(128);
  strcpy(menus->helptext,_("Press Esc to close window."));
  menus->name=malloc(1);
  strcpy(menus->name,"");
  menus->selected=0;
  menus->num_avail=MENU_INC;
  menus->items=malloc(sizeof(Menu_Item_Type *) * MENU_INC);

  /* Get the command output and create the menu items */
  pcommand=popen(command,"r");
  while ((str && strlen(str) > 0) || (str=realstr=pdgetline(pcommand,0))) {
    /* 
     * If we are not truncating, we have to handle wrapping lines that contain
     * tabs. This adds a lot of complexity and ugliness here. :-(
     */
    if (!truncate) {
      k=0;
      for (j=0;j<strlen(str);j++) {
	if (k == SLtt_Screen_Cols - 4 - 1) {
	  /*
	   * We have reached the end of the line before we reached the end
	   * of the string. Copy the processed part into the menu array,
	   * saving leftover part of string for later processing.
	   */
	  if (i >= menus->num_avail) { 
	    menus->num_avail+=MENU_INC;
	    menus->items=realloc(menus->items, sizeof(Menu_Item_Type *) *
				 menus->num_avail);
	  }
	  menus->items[i]=malloc(sizeof(Menu_Item_Type));
	  menus->items[i]->type=MENU_EXIT;
	  menus->items[i]->text=malloc(j+1);
	  strncpy(menus->items[i]->text,str,j);
	  menus->items[i]->text[j]='\0';
	  menus->items[i]->command=malloc(1);
	  strcpy(menus->items[i]->command,"");
	  menus->items[i]->hotkey=-1;
	  menus->items[i++]->next=NULL;
	  /* keep whittling away at the current string */
	  str=str+j;

	  /* Set j=0 to indicate we shouldn't add str to the list yet. */
	  j=0;
	  break;
	}
	/* Calculate length of string as it will appear on screen with tabs */
	if (str[j] == '\t') {
	  /* Figure out how many characters this tab will take up. */
	  k+=((j/SLsmg_Tab_Width)+1)*SLsmg_Tab_Width-j-1;
	}
	else
	  k++;
      } 

      /* If j == 0, this is a signal not to add str to the list yet. */
      if (j != 0) {
	if (i >= menus->num_avail) { 
	  menus->num_avail+=MENU_INC;
	  menus->items=realloc(menus->items, sizeof(Menu_Item_Type *) *
			       menus->num_avail);
	}
	menus->items[i]=malloc(sizeof(Menu_Item_Type));
	menus->items[i]->type=MENU_EXIT;
	menus->items[i]->text=malloc(j+1);
	strcpy(menus->items[i]->text,str);
	menus->items[i]->command=malloc(1);
	strcpy(menus->items[i]->command,"");
	menus->items[i]->hotkey=-1;
	menus->items[i++]->next=NULL;
	free(realstr);
	str=NULL;
      }
    }
    else {
      if (i >= menus->num_avail) { 
	menus->num_avail+=MENU_INC;
	menus->items=realloc(menus->items, sizeof(Menu_Item_Type *) *
			     menus->num_avail);
      }
      menus->items[i]=malloc(sizeof(Menu_Item_Type));
      menus->items[i]->type=MENU_EXIT;
      menus->items[i]->text=realstr;
      menus->items[i]->command=malloc(1);
      strcpy(menus->items[i]->command,"");
      menus->items[i]->hotkey=-1;
      menus->items[i++]->next=NULL;
      str=NULL;
    }
  }
  pclose(pcommand);

  menus->num=i;
  if (i==0) {
    DrawBase(_("Command returned no output"));
    SLsmg_refresh();
    RemoveMenu(menus);
  }
  else {
    menus->recalc=1;
    
    /* display the menu until they hit q or exit */
    AddWindow(menus);
    DrawAll();
    DoMenu(menus,NullAction,Handle_Ctrl_C);
    ExitWindow();
    RemoveMenu(menus);
  }
}