Exemple #1
0
/*=== close_collections_windows ==============================================
  ===========================================================================*/
void close_refund_windows(void)
{

  if (refund_detail_shell != NULL)
    hide_window(refund_detail_shell, refund_detail_form) ;

  if (refund_shell != NULL)
    hide_window(refund_shell, refund_form) ;

}
Exemple #2
0
/*=== close_collections_windows ==============================================
  ===========================================================================*/
void close_collections_windows(void)
{

  if (colc_shell != NULL)
    hide_window(colc_shell, colc_main_form) ;

  if (col_main_shell != NULL)
    hide_window(col_main_shell, col_main_form) ;

}
/*=== hide_aux_windows ======================================================
  Callback for Hide button on main screen and View Hide All menu option.
  Hides all the custaux windows and turns all toggles off.
  ===========================================================================*/
void
hide_aux_windows(Widget w,
                 XtPointer client_data,
                 XtPointer call_data)
{

  /* popdown all the windows */
  hide_window(ci_accountinfo_shell, ci_accountinfo_form) ;
  hide_window(ci_addrinfo_shell, ci_addrinfo_form) ;
  hide_window(ci_verifyinfo_shell, ci_verifyinfo_form) ;
  hide_window(ci_contactinfo_shell, ci_contactinfo_form) ;
  hide_window(ci_paymentinfo_shell, ci_paymentinfo_form) ;
  hide_window(ci_billinfo_shell, ci_billinfo_form) ;
  hide_window(ci_taxinfo_shell, ci_taxinfo_form) ;
  hide_window(ci_miscinfo_shell, ci_miscinfo_form) ;
  hide_window(cmf_sum_shell, cmf_sum_form) ;
  
  /* if this was called from code and not activated by a pushbutton, then
     don't reset toggles in view menu */
  if (w == NULL)
    return ;

  /* Then turn all toggles off to refect the state of things.  Pass FALSE 
   * as third parameter as to not activate the ValueChanged callbacks */
  XmToggleButtonSetState(ci_view_acct_btn, FALSE, FALSE) ; 
  XmToggleButtonSetState(ci_view_addr_btn, FALSE, FALSE) ; 
  XmToggleButtonSetState(ci_view_verify_btn, FALSE, FALSE) ; 
  XmToggleButtonSetState(ci_view_contact_btn, FALSE, FALSE) ; 
  XmToggleButtonSetState(ci_view_payment_btn, FALSE, FALSE) ; 
  XmToggleButtonSetState(ci_view_bill_btn, FALSE, FALSE) ; 
  XmToggleButtonSetState(ci_view_summary_btn, FALSE, FALSE) ; 
  XmToggleButtonSetState(ci_view_tax_btn, FALSE, FALSE) ; 
  XmToggleButtonSetState(ci_view_general_btn, FALSE, FALSE) ; 
  
}
Exemple #4
0
void hide_all_root_windows ()
{
	if (game_root_win >= 0) hide_window (game_root_win);
	if (console_root_win >= 0) hide_window (console_root_win);
	if (map_root_win >= 0) hide_window (map_root_win);
	if (login_root_win >= 0) hide_window (login_root_win);
	if (rules_root_win >= 0) hide_window (rules_root_win);
	if (opening_root_win >= 0) hide_window (opening_root_win);
	if (newchar_root_win >= 0) hide_window (newchar_root_win);
	if (update_root_win >= 0) hide_window (update_root_win);
	if (langsel_rootwin >= 0) hide_window (langsel_rootwin);
}
Exemple #5
0
/*=== close_eft_windows =====================================================
  ===========================================================================*/
void close_eft_windows()
{

  if (eft_shell != NULL)
    hide_window(eft_shell, eft_form) ;

}
Exemple #6
0
static int test_resize(window_t * win, display_t * disp)
{
   uint32_t w;
   uint32_t h;

   // prepare
   TEST(0 == show_window(win));
   WAITFOR(disp, isvisible_window(win));

   // TEST size_window
   TEST(0 == size_window(win, &w, &h));
   TEST(100 == w);
   TEST(100 == h);

   // TEST resize_window
   TEST(0 == resize_window(win, 200, 150));
   WAITFOR(disp, size_window(win, &w, &h) == 0 && w == 200);
   TEST(0 == size_window(win, &w, &h));
   TEST(200 == w);
   TEST(150 == h);
   TEST(0 == resize_window(win, 100, 100));
   WAITFOR(disp, size_window(win, &w, &h) == 0 && w == 100);
   TEST(0 == size_window(win, &w, &h));
   TEST(100 == w);
   TEST(100 == h);

   // unprepare
   TEST(0 == hide_window(win));
   WAITFOR(disp, ! isvisible_window(win));
   TEST(0 == isvisible_window(win));

   return 0;
ONERR:
   return EINVAL;
}
Exemple #7
0
static void deinit(void) {
  if (initialized)
    hide_window();
  else
    hide_loadscreen();
  app_message_deregister_callbacks();
}
Exemple #8
0
int keypress_update_root_handler (window_info *win, int mx, int my, Uint32 key, Uint32 unikey)
{
	Uint16 keysym = key & 0xffff;

	// first, try to see if we pressed Alt+x, to quit.
	if ( check_quit_or_fullscreen (key) )
	{
		return 1;
	}
	else if (keysym == SDLK_RETURN)
	{
		exit_now = 1;
		return 1;
	}
	else if (keysym == SDLK_ESCAPE)
	{
		update_countdown = -1;
		hide_window(update_root_win);
		show_window(window_to_show);
		LOG_TO_CONSOLE(c_red2, "You need to restart the client to activate the updates!");
		return 1;
	}
	
	return 1;
}
Exemple #9
0
//CLICK HANDLERS
int recipe_dropdown_click_handler(window_info *win, int mx, int my, Uint32 flags){

	static int last_clicked=0;
	static int last_recipe=0;

	if (flags & ELW_WHEEL_UP) {
		cur_recipe=(cur_recipe-1+SHOW_MAX_RECIPE)%SHOW_MAX_RECIPE;			
	} else
	if (flags & ELW_WHEEL_DOWN) {
		cur_recipe=(cur_recipe+1)%SHOW_MAX_RECIPE;			
	} else {
		//normal click
		select_window(recipe_win);
		cur_recipe=my/(33+1);	
		if ( ((SDL_GetTicks() - last_clicked) < 400)&& last_recipe==cur_recipe){
			//double click on the same recipe to select it and close the dropdown
			use_recipe(cur_recipe);
			recipes_shown=0;
			hide_window(recipe_win);
		}	
		last_clicked = SDL_GetTicks();
	}
	build_manufacture_list();
	last_recipe = cur_recipe;
	do_click_sound();
	return 1;
}
Exemple #10
0
int click_update_root_abort ()
{
	update_countdown = -1;
	hide_window(update_root_win);
	show_window(window_to_show);
	LOG_TO_CONSOLE(c_red2, "You need to restart the client to activate the updates!");
	return 1;
}
Exemple #11
0
void close_cmf_external_id_windows(void)
{
  if (ci_idterminate_shell)
    XtPopdown(ci_idterminate_shell);
  if (ci_iddetail_shell)
    hide_window(ci_iddetail_shell, ci_iddetail_form);
  if (ci_idinfo_shell)
    XtPopdown(ci_idinfo_shell);
}
Exemple #12
0
/*=== close_bill_review_windows =============================================
  ===========================================================================*/
void close_bill_review()
{

  if (xbr_shell != NULL)
    hide_window(xbr_shell, xbr_form) ;
  if (billsel_shell != NULL)
    XtPopdown (billsel_shell);

}
void deinit(void) {
  // Destroy main Window
  hide_window();
  //window_destroy(s_main_window);
  multi_window_bluetooth_connection_service_unsubscribe(bluetooth_handler);
  gbitmap_destroy(bluetooth_icon);
  bitmap_layer_destroy(bluetooth_layer);
  multi_window_accel_tap_service_unsubscribe(shake_handler);
}
Exemple #14
0
void window_key_hide(char dumb, char *dumber)
{
    in_window_command = 1;
    message_from(NULL, LOG_CURRENT);
    hide_window(curr_scr_win);
    update_all_windows();
    in_window_command = 0;
    message_from(NULL, LOG_CRAP);
}
Exemple #15
0
/* select the specified recipe and and make sure the window is hidden */
static void select_recipe(int the_recipe)
{
	cur_recipe = the_recipe;
	use_recipe(cur_recipe);
	recipes_shown=0;
	clear_recipe_filter();
	hide_window(recipe_win);
	build_manufacture_list();
}
Exemple #16
0
void display_manufacture_menu()
{
	if(manufacture_win < 0){
		static int clear_button_id=100;
		static int mixone_button_id=101;
		static int mixall_button_id=102;

		int our_root_win = -1;
			
		if (!windows_on_top) {
			our_root_win = game_root_win;
		}
		manufacture_win= create_window(win_manufacture, our_root_win, 0, manufacture_menu_x, manufacture_menu_y, manufacture_menu_x_len, manufacture_menu_y_len, ELW_WIN_DEFAULT);
		set_window_handler(manufacture_win, ELW_HANDLER_DISPLAY, &display_manufacture_handler );
		set_window_handler(manufacture_win, ELW_HANDLER_CLICK, &click_manufacture_handler );
		set_window_handler(manufacture_win, ELW_HANDLER_MOUSEOVER, &mouseover_manufacture_slot_handler );

		mixone_button_id=button_add_extended(manufacture_win, mixone_button_id,
			NULL, 33*6+15+10, manufacture_menu_y_len-36, 43, 0, 0, 1.0f, 0.77f, 0.57f, 0.39f, ">");
		widget_set_OnClick(manufacture_win, mixone_button_id, mixone_handler);
		widget_set_OnMouseover(manufacture_win, mixone_button_id, mouseover_mixone_handler);
		
		mixall_button_id=button_add_extended(manufacture_win, mixall_button_id,
			NULL, 33*8+10, manufacture_menu_y_len-36, 43, 0, 0, 1.0f, 0.77f, 0.57f, 0.39f, ">>");
		widget_set_OnClick(manufacture_win, mixall_button_id, mixall_handler);
		widget_set_OnMouseover(manufacture_win, mixall_button_id, mouseover_mixall_handler);
		
		clear_button_id=button_add_extended(manufacture_win, clear_button_id, NULL, 33*9+18+10, manufacture_menu_y_len-36, 70, 0, 0, 1.0f, 0.77f, 0.57f, 0.39f, clear_str);
		widget_set_OnClick(manufacture_win, clear_button_id, clear_handler);

		//Create a child window to show recipes in a dropdown panel
		recipe_win= create_window("w_recipe", manufacture_win, 0, 2, manufacture_menu_y_len-2, 33*6, SHOW_MAX_RECIPE*33, 
			ELW_TITLE_NONE|ELW_SHOW|ELW_USE_BACKGROUND|ELW_ALPHA_BORDER|ELW_SWITCHABLE_OPAQUE|ELW_USE_BORDER);
		set_window_handler(recipe_win, ELW_HANDLER_DISPLAY, &recipe_dropdown_draw);
		set_window_handler(recipe_win, ELW_HANDLER_CLICK, &recipe_dropdown_click_handler );
		set_window_handler(recipe_win, ELW_HANDLER_MOUSEOVER, &mouseover_recipe_handler );
		hide_window(recipe_win); //start hidden
	} else {
		show_window(manufacture_win);
		if (!recipes_shown) hide_window(recipe_win);
		else show_window(recipe_win);
		select_window(manufacture_win);
	}
}
Exemple #17
0
void close_book(int book_id)
{
	book *b=get_book(book_id);

	if(!b)
		return;
	if(book_win!=-1) {
		if((point)windows_list.window[book_win].data==(point)b) {
			hide_window(book_win);
		}
	}
	if(paper_win!=-1) {
		if((point)windows_list.window[paper_win].data == (point)b) {
			hide_window(paper_win);
		}
	}

	book_opened=-1;
}
int RecordMonitorGUI::close_event()
{
	thread->record->set_video_monitoring(0);
	thread->record->set_audio_monitoring(0);
	thread->record->video_window_open = 0;
	unlock_window();
	lock_window("RecordMonitorGUI::close_event");
	hide_window();
	return 0;
}
Exemple #19
0
void draw_scene()
{
	CHECK_GL_ERRORS();

	glClearColor(skybox_fog_color[0], skybox_fog_color[1], skybox_fog_color[2], 0.0);

	if(!shadows_on || !have_stencil)glClear(GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT);
	else glClear(GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);

	if (!have_display)
	{
		new_zoom_level = zoom_level;	// No scrolling when switching modes...
		if (quickbar_relocatable && quickbar_win >= 0) // Hack 
		{
			if (get_show_window (quickbar_win) && windows_list.window[quickbar_win].cur_x < window_width - hud_x && window_height - windows_list.window[quickbar_win].cur_y > hud_y)
				hide_window (quickbar_win);
		}
	}

	glLoadIdentity ();	// Reset The Matrix
	
	Enter2DMode ();
	display_windows (1);

	// Have to draw the dragged item *after* all windows
	
	glColor3f(1.0f,1.0f,1.0f);
	if (item_dragged != -1)
		drag_item (item_dragged, 0, 0);
	else if (use_item != -1 && current_cursor == CURSOR_USE_WITEM)
		drag_item (use_item, 0, 1);
	else if (storage_item_dragged != -1) 
		drag_item (storage_item_dragged, 1, 0);
	draw_special_cursors();

	Leave2DMode ();

	if(elwin_mouse >= 0)
	{
		if (current_cursor != elwin_mouse) change_cursor(elwin_mouse);
		elwin_mouse = -1;
	}
	
	SDL_GL_SwapBuffers();
	CHECK_GL_ERRORS();
	
	/* start or stop the harvesting effect depending on harvesting state */
	check_harvesting_effect();
	
	if (draw_delay > 0)
	{
		SDL_Delay (draw_delay);
		draw_delay = 0;
	}
}
Exemple #20
0
static void toggle_recipe_window(void)
{
	recipes_shown=!recipes_shown;
	if (recipes_shown)
		show_window(recipe_win);
	else
	{
		hide_window(recipe_win);
		clear_recipe_filter();
	}
}
Exemple #21
0
void release_grab (GromitData *data,
                   GdkDevice *dev)
{
    if(!dev) /* this means release all grabs */
    {
        GHashTableIter it;
        gpointer value;
        GromitDeviceData* devdata;
        g_hash_table_iter_init (&it, data->devdatatable);
        while (g_hash_table_iter_next (&it, NULL, &value))
        {
            devdata = value;
            if(devdata->is_grabbed)
            {
                gdk_error_trap_push();
                gdk_device_ungrab(devdata->device, GDK_CURRENT_TIME);
                XSync(GDK_DISPLAY_XDISPLAY(data->display), False);
                if(gdk_error_trap_pop())
                    g_printerr("WARNING: Ungrabbing device '%s' failed.\n", gdk_device_get_name(devdata->device));

                devdata->is_grabbed = 0;
                /* workaround buggy GTK3 ? */
                devdata->motion_time = 0;
            }
        }

        data->all_grabbed = 0;

        if(data->debug)
            g_printerr ("DEBUG: Ungrabbed all Devices.\n");

        return;
    }


    /* get the data for this device */
    GromitDeviceData *devdata = g_hash_table_lookup(data->devdatatable, dev);

    if (devdata->is_grabbed)
    {
        gdk_device_ungrab(devdata->device, GDK_CURRENT_TIME);
        devdata->is_grabbed = 0;
        /* workaround buggy GTK3 ? */
        devdata->motion_time = 0;


        if(data->debug)
            g_printerr ("DEBUG: Ungrabbed Device '%s'.\n", gdk_device_get_name(devdata->device));
    }

    if (!data->painted)
        hide_window (data);
}
Exemple #22
0
void setup_ov_mode(int on, int hide, int log)
{
#ifdef WANT_OPERVIEW 

char *default_oper = "wsckf";
Window *win = NULL;

	if (on)
	{
		if ((win = get_window_by_name("oper_view")))
		{
			if (win->log)
			do_log(0, NULL, &win->log_fp);
			delete_window(win);
			update_all_windows();
			set_input_prompt(current_window, get_string_var(INPUT_PROMPT_VAR), 0);
			cursor_to_input();
		}
		send_to_server("MODE %s -%s%s", get_server_nickname(from_server), get_string_var(OPER_MODES_VAR)?get_string_var(OPER_MODES_VAR):default_oper, send_umode);
	} 
	else 
	{
		Window *tmp = NULL;
		win = current_window;
		if ((tmp = new_window(current_window->screen)))
		{
			malloc_strcpy(&tmp->name, "oper_view");
			tmp->double_status = 0;
			if (hide)
				hide_window(tmp);
			else
				resize_window(1, tmp, -5);
			tmp->window_level = LOG_WALLOP|LOG_OPNOTE|LOG_SNOTE;
			tmp->absolute_size = 1;
			tmp->skip = 1;
			set_wset_string_var(tmp->wset, STATUS_FORMAT1_WSET, fget_string_var(FORMAT_OV_FSET));
			build_status(tmp, NULL, 0);
			update_all_windows();
			set_input_prompt(current_window, get_string_var(INPUT_PROMPT_VAR), 0);
			cursor_to_input();
			send_to_server("MODE %s +%s", get_server_nickname(from_server), get_string_var(OPER_MODES_VAR)?get_string_var(OPER_MODES_VAR):default_oper);
			set_screens_current_window(win->screen, win);
			tmp->mangler = operlog_line_mangler;
			if (log != -1)
			{
				tmp->log = log;
				if (tmp->log)
					do_log(log, "~/.BitchX/operview.log", &tmp->log_fp);
			}
		}
	}
#endif
}
Exemple #23
0
void display_book_window(book *b)
{
	int *p;

	if(!b)
		return;

	if(b->type==1){
		p=&paper_win;
		if(book_win!=-1)
			hide_window(book_win);
	} else {
		p=&book_win;
		if(paper_win!=-1)
			hide_window(paper_win);
	}
	book_opened = b->id;
	if(*p<0){
		if(b->type==1)
			*p=create_window(b->title, -1, 0, book_win_x, book_win_y, 320, 400, ELW_WIN_DEFAULT^ELW_CLOSE_BOX);
		else if(b->type==2)
			*p=create_window(b->title, -1, 0, book_win_x, book_win_y, 528, 320, ELW_WIN_DEFAULT^ELW_CLOSE_BOX); //width/height are different

		set_window_handler(*p, ELW_HANDLER_DISPLAY, &display_book_handler);
		set_window_handler(*p, ELW_HANDLER_MOUSEOVER, &mouseover_book_handler);
		set_window_handler(*p, ELW_HANDLER_CLICK, &click_book_handler);
		windows_list.window[*p].data=b;
	} else {
		if((point)windows_list.window[*p].data!=(point)b) {
			safe_snprintf(windows_list.window[*p].window_name, sizeof(windows_list.window[*p].window_name), "%s", b->title);
			windows_list.window[*p].data=b;
			if(!get_show_window(*p))
				show_window(*p);
			select_window(*p);
		} else if(!get_show_window(*p)) {
			show_window(*p);
			select_window(*p);
		}
	}
}
Exemple #24
0
static void toggle_recipe_window(void)
{
	if (!recipes_loaded)
		return;
	recipes_shown=!recipes_shown;
	if (recipes_shown)
		show_window(recipe_win);
	else
	{
		hide_window(recipe_win);
		clear_recipe_filter();
	}
}
Exemple #25
0
int GWindowGUI::close_event()
{
	hide_window();
	mwindow->session->show_gwindow = 0;
	unlock_window();

	mwindow->gui->lock_window("GWindowGUI::close_event");
	mwindow->gui->mainmenu->show_gwindow->set_checked(0);
	mwindow->gui->unlock_window();

	lock_window("GWindowGUI::close_event");
	mwindow->save_defaults();
	return 1;
}
Exemple #26
0
//	A common display handler callback for keypress activity.
//
int achievements_keypress_handler(window_info *win, int mx, int my, Uint32 key, Uint32 unikey)
{
	if (!win)
		return 0;
	if ((key & 0xffff) == SDLK_ESCAPE) // close window if Escape pressed
	{
		do_window_close_sound();
		if (key & ELW_CTRL)
			Achievements_System::get_instance()->hide_all();
		else
			hide_window(win->window_id);
		return 1;
	}
	return 0;
}
Exemple #27
0
static int click_add_buddy_handler(widget_list *w, int mx, int my, Uint32 flags)
{
	if(strlen((char*)buddy_name_buffer) == 0) {
		return 1;
	} else {
		char string[255];

		string[0] = RAW_TEXT;
		safe_snprintf(string+1, sizeof(string)-1, "#add_buddy %s", buddy_name_buffer);
		my_tcp_send(my_socket, (Uint8*)string, strlen(string+1)+1);
		hide_window(buddy_add_win);
		buddy_name_buffer[0] = '\0';
		description_buffer[0] = '\0';
		return 1;
	}
}
Exemple #28
0
int	click_in_window(int win_id, int x, int y, Uint32 flags)
{
    window_info *win;
    int	_x, _y;
   
	if(mouse_in_window(win_id, x, y) > 0)
		{
			// watch for needing to convert the globals into the flags
			// TODO: put this in the window manager
			if(!flags){
				if(shift_on)	flags |= ELW_SHIFT;
				if(ctrl_on)		flags |= ELW_CTRL;
				if(alt_on)		flags |= ELW_ALT;
				if(right_click)	flags |= ELW_RIGHT_MOUSE;
				//if(mid_click)	flags |= ELW_MID_MOUSE;
				if(left_click)	flags |= ELW_LEFT_MOUSE;
				//if(double_click)	flags |= ELW_DBL_CLICK;
			}
			win= &windows_list.window[win_id];
			_x= x - win->cur_x;
			_y= y - win->cur_y;
			//check the X for close - but hide it
			if(win->flags&ELW_CLOSE_BOX)
				{
        			if(_y>0 && _y<=20 && _x>(win->len_x-20) && _x<=win->len_x)
						{
							// the X was hit, hide this window
							hide_window(win_id);
							return 1;
						}				
				}
			
			//use the handler
			if(win->click_handler != NULL){
				glPushMatrix();
				glTranslatef((float)win->cur_x, (float)win->cur_y, 0.0f);
				(*win->click_handler)(win, _x, _y, flags);
				glPopMatrix();
				return	1;	// no click-thru permitted
			} else {
				return 1;
			}
		}

	return 0;
}
Exemple #29
0
static int test_showhide(window_t * win, display_t * disp)
{
   // TEST show_window
   TEST(0 == isvisible_window(win));
   TEST(0 == show_window(win));
   WAITFOR(disp, isvisible_window(win));
   TEST(1 == isvisible_window(win));

   // TEST hide_window
   TEST(1 == isvisible_window(win));
   TEST(0 == hide_window(win));
   WAITFOR(disp, ! isvisible_window(win));
   TEST(0 == isvisible_window(win));

   return 0;
ONERR:
   return EINVAL;
}
Exemple #30
0
void toggle_console(void* cp)
{
	console c = cp;
	(void)c;

	if (main_console->active == 1)
	{
		hide_window(main_console->win);
		main_console->active = 0;
		set_input(NULL, 0);
	}
	else
	{
		show_window(main_console->win);
		main_console->active = 1;
		set_input(main_console->tb_in->data, 1000);
	}
}