コード例 #1
0
ファイル: vsx_widget_desktop.cpp プロジェクト: Who828/vsxu
// VSX_WIDGET_DESKTOP **************************************************************************************************
// VSX_WIDGET_DESKTOP **************************************************************************************************
// VSX_WIDGET_DESKTOP **************************************************************************************************
// VSX_WIDGET_DESKTOP **************************************************************************************************
void vsx_widget_desktop::init() {

	//title = "vsx ultra::system menu";
	//menu = add(new vsx_widget_popup_menu,"desktop_menu");
	//menu->commands.adds(VSX_COMMAND_MENU, "connect to new server", "server_connect","");
	//menu->commands.adds(VSX_COMMAND_MENU, "quit (kill this client)", "system.shutdown","");
	//menu->commands.adds(VSX_COMMAND_MENU, "help;getting started", "a","");
	//menu->commands.adds(VSX_COMMAND_MENU, "help;about", "b","");
	//menu->size.x = 0.3;
	//menu->size.y = 0.5;

	// popup window
	add(new vsx_window_object_inspector(),"object_inspector");

#ifndef VSXU_PLAYER
	assistant = add(new vsxu_assistant(),"luna");
	front(assistant);
#endif

	enabled = true;
	name = "desktop";
	widget_type = VSX_WIDGET_TYPE_DESKTOP;

	init_children();

	log("welcome to vsxu");

	init_run = true;
	logo_time = 0;
	first_draw = true;
}
コード例 #2
0
ファイル: ipfw2_mod.c プロジェクト: polymorf/ipfw-user
int
ipfw_module_init(void)
{
	int ret = 0;

	rn_init(64);
	my_mod_register("ipfw",  1, moddesc_ipfw, NULL, NULL);
	my_mod_register("sy_ipfw",  2, NULL,
		sysinit_ipfw_init, sysuninit_ipfw_destroy);
	my_mod_register("sy_Vnet_ipfw",  3, NULL,
		sysinit_vnet_ipfw_init, sysuninit_vnet_ipfw_uninit);
	my_mod_register("dummynet",  4, moddesc_dummynet, NULL, NULL);
	my_mod_register("dn_fifo",  5, moddesc_dn_fifo, NULL, NULL);
	my_mod_register("dn_wf2qp",  6, moddesc_dn_wf2qp, NULL, NULL);
	my_mod_register("dn_rr",  7, moddesc_dn_rr, NULL, NULL);
	my_mod_register("dn_qfq",  8, moddesc_dn_qfq, NULL, NULL);
	my_mod_register("dn_prio",  9, moddesc_dn_prio, NULL, NULL);
	init_children();

#ifdef EMULATE_SYSCTL
	keinit_GST();
#endif 

	return ret;
}
コード例 #3
0
vsx_widget_base_editor::vsx_widget_base_editor() {
  scrollbar_horiz = (vsx_widget_scrollbar*)add(new vsx_widget_scrollbar,"horiz");
  scrollbar_vert = (vsx_widget_scrollbar*)add(new vsx_widget_scrollbar,"vert");
  editor = (vsx_widget_base_edit*)add(new vsx_widget_base_edit,"edit");
  init_children();
  editor->size_from_parent = true;
  scrollbar_horiz->scroll_type = 0;
  scrollbar_vert->scroll_type = 1;
  scrollbar_horiz->control_value = &editor->scrollbar_pos_x;
  scrollbar_vert->control_value = &editor->scrollbar_pos_y;
  allow_move_y = allow_move_x = false;
}
コード例 #4
0
ファイル: gui.cpp プロジェクト: SL-RU/rpb
GUIList::GUIList(int X, int Y, int W, int H, GUI* Gui):
  GUIParent(X, Y, Gui),
  data(new vector<GUIListItem*>),
  w(W),
  h(H),
  curPos(0),
  lables(new vector<GUILable*>)
{
  tab_priority = 1;
  gui->AddElementToTabList(this);
  init_children();
}
コード例 #5
0
ファイル: vsx_widget_window.cpp プロジェクト: ChunhuiWu/vsxu
void vsx_widget_window::init() {
  render_type = VSX_WIDGET_RENDER_2D;
  coord_type = VSX_WIDGET_COORD_CORNER;
  pos.y = 0.7f;
  set_size(vsx_vector(0.3f,0.3f));
  topmost = true;
  title = "window";
  constrained_x = false;
  constrained_y = false;
  visible = 1;
  target_pos = pos;
  target_size = size;
  support_interpolation = true;
  button_close = add(new vsx_widget_button,"bc1");
  init_children();
  init_run = true;


  button_close->title = "x";
  button_close->commands.adds(4,"close","close","bc1");
}
コード例 #6
0
ファイル: artiste_desktop.cpp プロジェクト: TheMindVirus/TMV
// VSX_WIDGET_DESKTOP **************************************************************************************************
// VSX_WIDGET_DESKTOP **************************************************************************************************
// VSX_WIDGET_DESKTOP **************************************************************************************************
// VSX_WIDGET_DESKTOP **************************************************************************************************
void vsx_widget_desktop::init()
{
  // popup window
  add(new vsx_window_object_inspector(),"object_inspector");

  assistant = add(new vsxu_assistant(),"luna");
  front(assistant);

  enabled = true;
  name = "desktop";
  widget_type = VSX_WIDGET_TYPE_DESKTOP;

  init_children();

  vsxf filesystem;
  font.init(PLATFORM_SHARED_FILES+"font"+DIRECTORY_SEPARATOR+"font-ascii.png", &filesystem);

  log("welcome to vsxu");

  init_run = true;
  logo_time = 0;
  first_draw = true;
}
コード例 #7
0
void vsx_widget_controller_sequence::init()
{
  if (init_run) return;
  init_children();
  init_run = true;
  set_size(vsx_vector(0.12f,0.1f));
  seq_chan = add(new vsx_widget_seq_channel,"chan");
  if (size_controlled_from_outside)
  {
  	seq_chan->size = size;
  } else
  {
  	seq_chan->size = size*0.95f;
  }
  seq_chan->target_size = seq_chan->size;
  seq_chan->init();
  seq_chan->visible = 1;
  ((vsx_widget_seq_channel*)seq_chan)->set_view_time(-0.05f, 1.05f);
  ((vsx_widget_seq_channel*)seq_chan)->hidden_by_sequencer = false;
  ((vsx_widget_seq_channel*)seq_chan)->y_start = -0.15f;
  ((vsx_widget_seq_channel*)seq_chan)->y_end = 1.1f;
  ((vsx_widget_seq_channel*)seq_chan)->is_controller = true;
  get_value();
}
コード例 #8
0
ファイル: libwdi_dlg.c プロジェクト: amiit/libwdi
/*
 * Callback for the run_with_progress_bar() function
 */
static LRESULT CALLBACK progress_callback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
	LRESULT loc;
	HANDLE handle;
	static int installation_time = 0;	// active installation time, in secs
	const int msg_max = ARRAYSIZE(progress_message);
	static int msg_index = 0;
	int i;
	// coordinates that we want to disable (=> no resize)
	static LRESULT disabled[9] = { HTLEFT, HTRIGHT, HTTOP, HTBOTTOM, HTSIZE,
		HTTOPLEFT, HTTOPRIGHT, HTBOTTOMLEFT, HTBOTTOMRIGHT };

	switch (message) {

	case WM_CREATE:
		// Reset static variables
		installation_time = 0;
		msg_index = 0;
		hProgress = hDlg;

		// Start modal (disable parent Window)
		EnableWindow(GetParent(hDlg), FALSE);

		init_children(hProgress);
		center_dialog(hProgress);

		// Send a WM_TIMER message every second
		SetTimer(hProgress, 1, 1000, NULL);

		PostMessage(hProgress, UM_PROGRESS_START, 0, 0);

		return (INT_PTR)TRUE;

	case WM_NCHITTEST:
		// Check coordinates to prevent resize actions
		loc = DefWindowProc(hDlg, message, wParam, lParam);
		for(i = 0; i < 9; i++) {
			if (loc == disabled[i]) {
				return (INT_PTR)TRUE;
			}
		}
		return (INT_PTR)FALSE;

	case UM_PROGRESS_START:
		if (progress_thid != -1L) {
			wdi_err("program assertion failed - another operation is in progress");
		} else {
			// Using a thread prevents application freezout on security warning
			progress_thid = _beginthread(progress_thread, 0, NULL);
			if (progress_thid != -1L) {
				return (INT_PTR)TRUE;
			}
			wdi_err("unable to create progress_thread");
		}
		// Fall through and return an error
		wParam = (WPARAM)WDI_ERROR_RESOURCE;

	case UM_PROGRESS_STOP:
		// If you don't re-enable the parent Window before leaving
		// all kind of bad things happen (other Windows get activated, etc.)
		EnableWindow(GetParent(hDlg), TRUE);
		PostQuitMessage((int)wParam);
		DestroyWindow(hProgress);
		return (INT_PTR)TRUE;

	case WM_TIMER:
		if (find_security_prompt() == NULL) {
			installation_time++;	// Only increment outside of security prompts
			if ( (msg_index < msg_max) && (installation_time > 15*(msg_index+1)) ) {
				// Change the progress blurb
				SetWindowTextA(hProgressText, progress_message[msg_index]);
				// Force a full redraw fot the transparent text background
				ShowWindow(hProgressText, SW_HIDE);
				UpdateWindow(hProgressText);
				ShowWindow(hProgressText, SW_SHOW);
				UpdateWindow(hProgressText);
				msg_index++;
			} else if ( (installation_time > 300) && (progress_thid != -1L) ) {
				// Wait 300 (loose) seconds and kill the thread
				// 300 secs is the timeout for driver installation on Vista
				wdi_err("progress timeout expired - KILLING THREAD!");
				handle = OpenThread(THREAD_TERMINATE, FALSE, (DWORD)progress_thid);
				TerminateThread(handle, -1);
				CloseHandle(handle);
				PostQuitMessage(WDI_ERROR_TIMEOUT);
				DestroyWindow(hProgress);
				return (INT_PTR)FALSE;
			}
		}
		return (INT_PTR)TRUE;

	case WM_CLOSE:		// prevent closure using Alt-F4
		return (INT_PTR)TRUE;

	case WM_DESTROY:	// close application
		hProgress = INVALID_HANDLE_VALUE;
		return (INT_PTR)FALSE;

	case WM_CTLCOLORSTATIC:
		pSetBkMode((HDC)wParam, TRANSPARENT);
		return (INT_PTR)pGetStockObject(NULL_BRUSH);
	}
	return DefWindowProc(hDlg, message, wParam, lParam);
}
コード例 #9
0
void vsx_widget_controller_dialog::init()
{
  if (init_run) return;
  vsx_widget_controller_base::init();
  init_children();
}