/*
 * o1k_conf_stubs.c - Notify and event callback function stubs.
 * This file was generated by `gxv' from `o1k_conf.G'.
 */

#include <stdio.h>
#include <sys/param.h>
#include <sys/types.h>
#include <xview/xview.h>
#include <xview/panel.h>
#include <xview/textsw.h>
#include <xview/xv_xrect.h>
#include "o1k_conf_ui.h"

#include "o1k_conf.h"

/* for control timer */
static struct itimerval	control_timer;
o1k_conf_call_timeout_popup_objects	*O1k_conf_call_timeout_popup;
o1k_conf_jpeg_popup_objects	*O1k_conf_jpeg_popup;
extern Notify_value control_func(...);

/*
 * Global object definitions.
 */
o1k_conf_main_window_objects	*O1k_conf_main_window;
o1k_conf_setup_popup_objects	*O1k_conf_setup_popup;
o1k_conf_audio_popup_objects	*O1k_conf_audio_popup;
o1k_conf_cellb_popup_objects	*O1k_conf_cellb_popup;
o1k_conf_avpanel_popup_objects	*O1k_conf_avpanel_popup;
o1k_conf_address_popup_objects	*O1k_conf_address_popup;
o1k_conf_h261_popup_objects	*O1k_conf_h261_popup;
o1k_conf_status_popup_objects	*O1k_conf_status_popup;
o1k_conf_join_popup_objects	*O1k_conf_join_popup;

char dev_name[40] = "/dev/o1k0";

/*
  Compiler Bug ID: 1166948
  Synopsis: Using misaligned data with threaded applications 
            can cause a bus error. 
  
  Problem Description:
  
  When a thread that is not running on the same lightweight process (LWP)
  as main() accesses a misaligned data element, a bus error and core dump
  can occur.
  
  The C compiler assumes that the misaligned data handler is process-wide, 
  while the operating system assumes it is a per-LWP handler. Only the
  main LWP in the process has a misaligned handler. If more LWPs are
  created, they will not inherit the misalignment handler that was
  installed. A workaround exists. The problem will be fixed in a 
  future release of the operating system.
*/

int  register_trap = 1;

/*
 * For the moment, this application does not have a good method
 * for telling the far end if the video is pal or not. The issue
 * is mute for h261 since the video encode is the same size for
 * pal as for ntsc. So for the moment, we are using this flag
 * as an indicator if pal video is coming from the far end.
 */
int receive_pal_video = 0;

/*
 * XIL 1.2 (Pre Solaris 2.6) is not MT-Safe. Therefore, We must 
 * use a mutex around xil calls in different threads. XIL 1.3
 * in Solaris 2.6 is MT-Safe. Thus we can disable the lock for
 * it. At the moment, we are asking the user to disable to lock
 * via a cmd line options...
 */
int use_xil_locks = 1;

void usage(char* progname)
{
  printf("usage: %s [options] [flags] \n",progname);
  printf("options:                       - default -\n");
  printf("  -D devname   : device name    /dev/o1k0\n");
  printf("  -v val       : verbose level      0\n");
  printf("  -u user@host : set user@host     none\n");  
  printf("flags: \n");
  printf("  -p           : receive PAL format flag\n");  
  printf("  -t           : disable thread misalign data trap \n");  
  printf("  -x           : disable xil mutex locking (use for Solaris 2.6+ only) \n");  
  exit(0);
}

#define MAIN
#ifdef MAIN

/*
 * Instance XV_KEY_DATA key.  An instance is a set of related
 * user interface objects.  A pointer to an object's instance
 * is stored under this key in every object.  This must be a
 * global variable.
 */
Attr_attribute	INSTANCE;

main(int argc, char **argv)
{
  int i;
  O1kConf* c;
  char userhost[80];

  strcpy(userhost, "");
  
  /*
   * Initialize XView.
   */
  xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL);
  INSTANCE = xv_unique_key();

  for (i=1; i<argc; i++){
    switch (argv[i][1]){
      case 'D':
      {
        strncpy(dev_name,argv[++i],40);
        break;
      }
      case 'v':
      {
        verbose = atoi(argv[++i]);
        break;
      }
      case 't':
      {
        register_trap = 0;
        break;
      }
      case 'u':
      {
        strncpy(userhost,argv[++i],80);
        break;
      }
      case 'p':
      {
        receive_pal_video = 1;
        break;
      }
      case 'x':
      {
        use_xil_locks = 0;
        break;
      }
      default:
      {
        printf("unknown option %c\n",argv[i][1]);
        usage(argv[0]);
        break;
      }
    }
  }
  
  /*
   * Initialize user interface components.
   * Do NOT edit the object initializations by hand.
   */
  O1k_conf_main_window = o1k_conf_main_window_objects_initialize(NULL, NULL);
  O1k_conf_setup_popup = o1k_conf_setup_popup_objects_initialize(NULL, O1k_conf_main_window->main_window);
  O1k_conf_audio_popup = o1k_conf_audio_popup_objects_initialize(NULL, O1k_conf_main_window->main_window);
  O1k_conf_cellb_popup = o1k_conf_cellb_popup_objects_initialize(NULL, O1k_conf_main_window->main_window);
  O1k_conf_avpanel_popup = o1k_conf_avpanel_popup_objects_initialize(NULL, O1k_conf_main_window->main_window);
  O1k_conf_address_popup = o1k_conf_address_popup_objects_initialize(NULL, O1k_conf_main_window->main_window);
  O1k_conf_h261_popup = o1k_conf_h261_popup_objects_initialize(NULL, O1k_conf_main_window->main_window);
  O1k_conf_status_popup = o1k_conf_status_popup_objects_initialize(NULL, O1k_conf_main_window->main_window);
  O1k_conf_join_popup = o1k_conf_join_popup_objects_initialize(NULL, O1k_conf_main_window->main_window);
  O1k_conf_call_timeout_popup = o1k_conf_call_timeout_popup_objects_initialize(NULL, O1k_conf_main_window->main_window);
  O1k_conf_jpeg_popup = o1k_conf_jpeg_popup_objects_initialize(NULL, O1k_conf_main_window->main_window);
  
#ifdef O1K_ZIPPY
  xv_set(O1k_conf_avpanel_popup->avpanel_vid_outputsel_setting, XV_SHOW, FALSE, NULL);
#endif
  
  c = new O1kConf();
  if (!c){
    fprintf(stderr,"could not create O1kConf\n");
    exit(0);
  }

  if (strcmp(userhost,"") != 0){
    xv_set(O1k_conf_main_window->main_user_tf, PANEL_VALUE, userhost, NULL);
    conf->network->setUserHost(userhost);
    xv_set(O1k_conf_main_window->call_b, PANEL_INACTIVE, FALSE, NULL);
  }
  
  /* setup control timer */
  control_timer.it_value.tv_sec     = 2; /* initial timeout */
  control_timer.it_value.tv_usec    = 0;
  control_timer.it_interval.tv_sec  = 2; /* subsequent timeouts */
  control_timer.it_interval.tv_usec = 0;
  notify_set_itimer_func(O1k_conf_main_window->main_window,
                         control_func, ITIMER_REAL, &control_timer, NULL);
  
  /*
   * Turn control over to XView.
   */
  
  xv_main_loop(O1k_conf_main_window->main_window);

  /* turn off controll timer */
  notify_set_itimer_func(O1k_conf_main_window->main_window,
                         NOTIFY_FUNC_NULL, ITIMER_REAL, NULL, NULL);
  
  o1k_conf_exit(0);
  
  exit(0);

  return 0;
}

#endif

/*
 * Custom function to init params
 */

int init_params()
{
  int v;
  static int init_flag = 1;

  if (!init_flag)
    return 0;
  init_flag = 0;
#if 0
  xv_set(O1k_conf_h261_popup->h261_cif_setting,       PANEL_VALUE, conf->video.h261.pip_on, NULL);
  xv_set(O1k_conf_h261_popup->h261_pip_setting,       PANEL_VALUE, conf->video.h261.size, NULL);  
  xv_set(O1k_conf_h261_popup->h261_bitrate_slider,    PANEL_VALUE, conf->video.h261.bitrate, NULL);  
  xv_set(O1k_conf_h261_popup->h261_quant_slider,      PANEL_VALUE, conf->video.h261.maxquant, NULL);  
  xv_set(O1k_conf_h261_popup->h261_frame_rate_slider, PANEL_VALUE, conf->video.h261.framerate, NULL);  
  xv_set(O1k_conf_h261_popup->h261_refresh_slider,    PANEL_VALUE, conf->video.h261.refreshperiod, NULL);  

  xv_set(O1k_conf_cellb_popup->cellb_cif_setting,       PANEL_VALUE, conf->video.cellb.size, NULL);
  xv_set(O1k_conf_cellb_popup->cellb_frame_rate_slider, PANEL_VALUE, conf->video.cellb.framerate, NULL);    

  xv_set(O1k_conf_audio_popup->audio_channels_setting,      PANEL_VALUE, conf->audio.channels, NULL);
  xv_set(O1k_conf_audio_popup->audio_sampling_rate_setting, PANEL_VALUE, conf->audio.sample_rate, NULL);
  xv_set(O1k_conf_audio_popup->audio_echo_suppress_setting, PANEL_VALUE, conf->audio.aes_on, NULL);

  xv_set(O1k_conf_setup_popup->video_setting, PANEL_ITEM, conf->video.type, NULL);
  xv_set(O1k_conf_setup_popup->audio_setting, PANEL_ITEM, conf->audio.type, NULL);  

  xv_set(O1k_conf_avpanel_popup->audio_volume_slider,  PANEL_ITEM, conf->audio.vol_output, NULL);
  xv_set(O1k_conf_avpanel_popup->audio_gain_slider,    PANEL_ITEM, conf->audio.vol_input, NULL);
  xv_set(O1k_conf_avpanel_popup->audio_monitor_slider, PANEL_ITEM, conf->audio.vol_monitor, NULL);

  xv_set(O1k_conf_avpanel_popup->audio_output_enable_setting, PANEL_ITEM, conf->audio.enable_output, NULL);
  xv_set(O1k_conf_avpanel_popup->audio_input_enable_setting,  PANEL_ITEM, conf->audio.enable_input, NULL);

  xv_set(O1k_conf_avpanel_popup->avpanel_aud_inputsel_setting, PANEL_ITEM, conf->video.port, NULL);  
  xv_set(O1k_conf_avpanel_popup->avpanel_vid_inputsel_setting, PANEL_ITEM, conf->audio.port, NULL);
 
#if 0
  xv_set(O1k_conf_avpanel_popup->avpanel_brightness_slider, PANEL_ITEM, conf->video.brightness, NULL);  
  xv_set(O1k_conf_avpanel_popup->avpanel_contrast_slider,   PANEL_ITEM, conf->video.contrast, NULL);  
  xv_set(O1k_conf_avpanel_popup->avpanel_hue_slider,        PANEL_ITEM, conf->video.hue, NULL);  
  xv_set(O1k_conf_avpanel_popup->avpanel_gainu_slider,      PANEL_ITEM, conf->video.gainu, NULL);
  xv_set(O1k_conf_avpanel_popup->avpanel_gainv_slider,      PANEL_ITEM, conf->video.gainv, NULL);    
#endif
#endif
  
  return 0;
}

/*
 * Menu handler for `view_m (Local Video)'.
 */
Menu_item
show_local_video(Menu_item item, Menu_generate op)
{
	o1k_conf_main_window_objects * ip = (o1k_conf_main_window_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
	
	switch (op) {
	case MENU_DISPLAY:
		break;

	case MENU_DISPLAY_DONE:
		break;

	case MENU_NOTIFY:
                conf->video->setViewLocal(1);
		
		/* gxv_start_connections DO NOT EDIT THIS SECTION */

		/* gxv_end_connections */

		break;

	case MENU_NOTIFY_DONE:
		break;
	}
	return item;
}

/*
 * Menu handler for `view_m (Far Video)'.
 */
Menu_item
show_far_video(Menu_item item, Menu_generate op)
{
	o1k_conf_main_window_objects * ip = (o1k_conf_main_window_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
	
	switch (op) {
	case MENU_DISPLAY:
		break;

	case MENU_DISPLAY_DONE:
		break;

	case MENU_NOTIFY:
                conf->video->setViewFar(1);
		/* gxv_start_connections DO NOT EDIT THIS SECTION */

		/* gxv_end_connections */

		break;

	case MENU_NOTIFY_DONE:
		break;
	}
	return item;
}

/*
 * Menu handler for `view_m (Status)'.
 */

static int vh, ah, nh, ch;
static int status_init = 1;

Menu_item
o1k_conf_view_m_item2_callback(Menu_item item, Menu_generate op)
{
	o1k_conf_main_window_objects * ip = (o1k_conf_main_window_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
	
	switch (op) {
	case MENU_DISPLAY:
		break;

	case MENU_DISPLAY_DONE:
		break;

	case MENU_NOTIFY:
                if (status_init){
                  extern int AUDIO_WRITE_SHADOW;
                  /*AUDIO_WRITE_SHADOW = 1;*/
                  vh = xv_get(O1k_conf_status_popup->status_video_controls, XV_HEIGHT);
                  ah = xv_get(O1k_conf_status_popup->status_audio_controls, XV_HEIGHT);
                  nh = xv_get(O1k_conf_status_popup->status_network_controls, XV_HEIGHT);
                  ch = xv_get(O1k_conf_status_popup->status_controls, XV_HEIGHT);
                  status_init = 0;
                }

		/* gxv_start_connections DO NOT EDIT THIS SECTION */

		xv_set(O1k_conf_status_popup->status_popup, FRAME_CMD_PUSHPIN_IN, TRUE, NULL);
		xv_set(O1k_conf_status_popup->status_popup, XV_SHOW, TRUE, NULL);
		
		/* gxv_end_connections */

		break;

	case MENU_NOTIFY_DONE:
		break;
	}
	return item;
}

/*
 * Menu handler for `ab_sort_menu'.
 */
Menu
ab_sort(Menu menu, Menu_generate op)
{
	o1k_conf_address_popup_objects * ip = (o1k_conf_address_popup_objects *) xv_get(menu, XV_KEY_DATA, INSTANCE);
	
	switch (op) {
	case MENU_DISPLAY:
		break;

	case MENU_DISPLAY_DONE:
		break;

	case MENU_NOTIFY:
		
		/* gxv_start_connections DO NOT EDIT THIS SECTION */

		/* gxv_end_connections */

		break;

	case MENU_NOTIFY_DONE:
		break;
	}
	return menu;
}

void ab_relist()
{
  int nrows, i;
  O1kUserNode* unp;
  
  char f[O1K_AB_MAX_STRING];
  char l[O1K_AB_MAX_STRING];  
  char e[O1K_AB_MAX_STRING];  
  char p[O1K_AB_MAX_STRING];  
  char u[O1K_AB_MAX_STRING];
  char* buf = u;
  
  nrows = (int)xv_get(O1k_conf_address_popup->list1, PANEL_LIST_NROWS);

  xv_set(O1k_conf_address_popup->list1,
         PANEL_LIST_DELETE_ROWS, 0, nrows,
         NULL);

  switch (conf->addressbook->getSort()){
    case SORT_USER:  buf = u; break;
    case SORT_FIRST: buf = f; break;
    case SORT_LAST:  buf = l; break;
    case SORT_EMAIL: buf = e; break;
  }
  
  for (i = 0, unp = conf->addressbook->getFirstUser();
       unp != NULL;
       i++, unp = conf->addressbook->getNextUser(unp)){
    conf->addressbook->getUserInfo(unp, f, l, e, p, u);
    xv_set(O1k_conf_address_popup->list1,
           PANEL_LIST_INSERT, i,
           PANEL_LIST_STRING, i, buf,
           NULL);
  }
}

void ab_show_select(char* s)
{
  char f[O1K_AB_MAX_STRING];
  char l[O1K_AB_MAX_STRING];  
  char e[O1K_AB_MAX_STRING];  
  char p[O1K_AB_MAX_STRING];  
  char u[O1K_AB_MAX_STRING];
  
  if (strcmp(s, "") == 0){
    xv_set(O1k_conf_address_popup->ab_userhost_textfield, PANEL_VALUE, "", NULL);
    xv_set(O1k_conf_address_popup->ab_firstname_textfield, PANEL_VALUE, "", NULL);
    xv_set(O1k_conf_address_popup->ab_lastname_textfield, PANEL_VALUE, "", NULL);
    xv_set(O1k_conf_address_popup->ab_phone_textfield, PANEL_VALUE, "", NULL);
    xv_set(O1k_conf_address_popup->ab_email_textfield, PANEL_VALUE, "", NULL);
  } else {
    conf->addressbook->getUserInfo(conf->addressbook->getSort(), s, f, l, e, p, u);
    xv_set(O1k_conf_address_popup->ab_userhost_textfield, PANEL_VALUE, u, NULL);
    xv_set(O1k_conf_address_popup->ab_firstname_textfield, PANEL_VALUE, f, NULL);
    xv_set(O1k_conf_address_popup->ab_lastname_textfield, PANEL_VALUE, l, NULL);
    xv_set(O1k_conf_address_popup->ab_phone_textfield, PANEL_VALUE, p, NULL);
    xv_set(O1k_conf_address_popup->ab_email_textfield, PANEL_VALUE, e, NULL);
  }
}

/*
 * Menu handler for `ab_file_menu (Load)'.
 */
Menu_item
ab_file_load(Menu_item item, Menu_generate op)
{
	o1k_conf_address_popup_objects * ip = (o1k_conf_address_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
	
	switch (op) {
	case MENU_DISPLAY:
		break;

	case MENU_DISPLAY_DONE:
		break;

	case MENU_NOTIFY:
                
                conf->addressbook->load();
                ab_relist();
		/* gxv_start_connections DO NOT EDIT THIS SECTION */

		/* gxv_end_connections */

		break;

	case MENU_NOTIFY_DONE:
		break;
	}
	return item;
}

/*
 * Menu handler for `ab_file_menu (Store)'.
 */
Menu_item
ab_file_store(Menu_item item, Menu_generate op)
{
	o1k_conf_address_popup_objects * ip = (o1k_conf_address_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
	
	switch (op) {
	case MENU_DISPLAY:
		break;

	case MENU_DISPLAY_DONE:
		break;

	case MENU_NOTIFY:
                conf->addressbook->store();
		/* gxv_start_connections DO NOT EDIT THIS SECTION */

		/* gxv_end_connections */

		break;

	case MENU_NOTIFY_DONE:
		break;
	}
	return item;
}

/*
 * Notify callback function for `setup_b'.
 */
void
o1k_conf_main_window_setup_b_notify_callback(Panel_item item, Event *event)
{
  o1k_conf_main_window_objects *ip = (o1k_conf_main_window_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  init_params();	
	
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	xv_set(O1k_conf_main_window->call_b, XV_SHOW, TRUE, NULL);
	
	xv_set(O1k_conf_main_window->hangup_b, PANEL_INACTIVE, TRUE, NULL);
	
	xv_set(O1k_conf_setup_popup->setup_popup, FRAME_CMD_PUSHPIN_IN, TRUE, NULL);
	xv_set(O1k_conf_setup_popup->setup_popup, XV_SHOW, TRUE, NULL);
	
	/* gxv_end_connections */

}

/*
 * Notify callback function for `call_b'.
 */
void
o1k_conf_main_window_call_b_notify_callback(Panel_item item, Event *event)
{
	o1k_conf_main_window_objects *ip = (o1k_conf_main_window_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
	
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	xv_set(O1k_conf_main_window->setup_b, PANEL_INACTIVE, TRUE, NULL);
	
	if (xv_get(O1k_conf_main_window->main_window, FRAME_CLOSED))
		xv_set(O1k_conf_main_window->main_window, FRAME_CLOSED, FALSE, NULL);

	xv_set(O1k_conf_main_window->main_window, XV_SHOW, TRUE, NULL);
	
	xv_set(O1k_conf_main_window->main_window, FRAME_LEFT_FOOTER, "Calling", NULL);
	
	xv_set(O1k_conf_main_window->call_b, XV_SHOW, FALSE, NULL);
	
	xv_set(O1k_conf_main_window->call_b, PANEL_INACTIVE, TRUE, NULL);
	
	xv_set(O1k_conf_main_window->hangup_b, PANEL_INACTIVE, FALSE, NULL);
	
	xv_set(O1k_conf_main_window->hangup_b, XV_SHOW, TRUE, NULL);
	
	xv_set(O1k_conf_setup_popup->setup_popup, FRAME_CMD_PUSHPIN_IN, FALSE, NULL);
	xv_set(O1k_conf_setup_popup->setup_popup, XV_SHOW, FALSE, NULL);
	
	xv_set(O1k_conf_audio_popup->audio_popup, XV_SHOW, FALSE, NULL);
	
	xv_set(O1k_conf_cellb_popup->cellb_popup, XV_SHOW, FALSE, NULL);
	
	xv_set(O1k_conf_h261_popup->h261_popup, XV_SHOW, FALSE, NULL);
	
	xv_set(O1k_conf_jpeg_popup->jpeg_popup, XV_SHOW, FALSE, NULL);
	
	/* gxv_end_connections */

        xv_set(O1k_conf_main_window->hangup_b, XV_SHOW, TRUE, NULL);
        xv_set(O1k_conf_h261_popup->h261_cif_setting, PANEL_INACTIVE, TRUE, NULL);
        xv_set(O1k_conf_cellb_popup->cellb_cif_setting, PANEL_INACTIVE, TRUE, NULL);
        xv_set(O1k_conf_jpeg_popup->jpeg_cif_setting, PANEL_INACTIVE, TRUE, NULL);
        xv_set(O1k_conf_avpanel_popup->avpanel_vid_outputsel_setting, PANEL_INACTIVE, TRUE, NULL);
        conf->call();
  
}

/*
 * Notify callback function for `hangup_b'.
 */
void
o1k_conf_main_window_hangup_b_notify_callback(Panel_item item, Event *event)
{
	o1k_conf_main_window_objects *ip = (o1k_conf_main_window_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
	
        xv_set(O1k_conf_main_window->main_window, FRAME_LEFT_FOOTER, "Hanging Up", NULL);
        
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	xv_set(O1k_conf_main_window->setup_b, PANEL_INACTIVE, FALSE, NULL);
	
	if (xv_get(O1k_conf_main_window->main_window, FRAME_CLOSED))
		xv_set(O1k_conf_main_window->main_window, FRAME_CLOSED, FALSE, NULL);

	xv_set(O1k_conf_main_window->main_window, XV_SHOW, TRUE, NULL);
	
	xv_set(O1k_conf_main_window->call_b, XV_SHOW, TRUE, NULL);
	
	xv_set(O1k_conf_main_window->call_b, PANEL_INACTIVE, FALSE, NULL);
	
	xv_set(O1k_conf_main_window->hangup_b, XV_SHOW, FALSE, NULL);
	
	xv_set(O1k_conf_main_window->hangup_b, PANEL_INACTIVE, TRUE, NULL);
	
	/* gxv_end_connections */

        xv_set(O1k_conf_main_window->call_b, XV_SHOW, TRUE, NULL);
        xv_set(O1k_conf_h261_popup->h261_cif_setting, PANEL_INACTIVE, FALSE, NULL);
        xv_set(O1k_conf_cellb_popup->cellb_cif_setting, PANEL_INACTIVE, FALSE, NULL);
        xv_set(O1k_conf_jpeg_popup->jpeg_cif_setting, PANEL_INACTIVE, FALSE, NULL);
        xv_set(O1k_conf_avpanel_popup->avpanel_vid_outputsel_setting, PANEL_INACTIVE, FALSE, NULL);
        
        conf->hangup();
        xv_set(O1k_conf_main_window->main_window, FRAME_LEFT_FOOTER, "", NULL);                
}

/*
 * Notify callback function for `address_b'.
 */
void
o1k_conf_main_window_address_b_notify_callback(Panel_item item, Event *event)
{
	o1k_conf_main_window_objects *ip = (o1k_conf_main_window_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
	
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	xv_set(O1k_conf_address_popup->address_popup, FRAME_CMD_PUSHPIN_IN, TRUE, NULL);
	xv_set(O1k_conf_address_popup->address_popup, XV_SHOW, TRUE, NULL);
	
	/* gxv_end_connections */

}

/*
 * Notify callback function for `av_panel_button'.
 */
void
o1k_conf_main_window_av_panel_button_notify_callback(Panel_item item, Event *event)
{
  o1k_conf_main_window_objects *ip = (o1k_conf_main_window_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  init_params();		
	
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	xv_set(O1k_conf_avpanel_popup->avpanel_popup, FRAME_CMD_PUSHPIN_IN, TRUE, NULL);
	xv_set(O1k_conf_avpanel_popup->avpanel_popup, XV_SHOW, TRUE, NULL);
	
	/* gxv_end_connections */

}

/*
 * Notify callback function for `video_setting'.
 */
void
set_video_format(Panel_item item, int value, Event *event)
{
  o1k_conf_setup_popup_objects *ip = (o1k_conf_setup_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  int iflag;
  
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	if (value == 0)
	{
		xv_set(O1k_conf_cellb_popup->cellb_popup, XV_SHOW, FALSE, NULL);
	}
	
	if (value == 2)
	{
		xv_set(O1k_conf_cellb_popup->cellb_popup, XV_SHOW, FALSE, NULL);
	}
	
	if (value == 3)
	{
		xv_set(O1k_conf_cellb_popup->cellb_popup, XV_SHOW, FALSE, NULL);
	}
	
	if (value == 1)
	{
		xv_set(O1k_conf_h261_popup->h261_popup, XV_SHOW, FALSE, NULL);
	}
	
	if (value == 2)
	{
		xv_set(O1k_conf_h261_popup->h261_popup, XV_SHOW, FALSE, NULL);
	}
	
	if (value == 3)
	{
		xv_set(O1k_conf_h261_popup->h261_popup, XV_SHOW, FALSE, NULL);
	}
	
	if (value == 1)
	{
		xv_set(O1k_conf_jpeg_popup->jpeg_popup, XV_SHOW, FALSE, NULL);
	}
	
	if (value == 3)
	{
		xv_set(O1k_conf_jpeg_popup->jpeg_popup, XV_SHOW, FALSE, NULL);
	}
	
	if (value == 0)
	{
		xv_set(O1k_conf_jpeg_popup->jpeg_popup, XV_SHOW, FALSE, NULL);
	}
	
	/* gxv_end_connections */

  conf->video->setFormat((VideoType)value);
  if (value == VID_NONE){
    iflag = TRUE;
  } else {
    iflag = FALSE;
  }
  xv_set(O1k_conf_avpanel_popup->avpanel_vid_inputsel_setting, PANEL_INACTIVE, iflag, NULL);
  xv_set(O1k_conf_avpanel_popup->avpanel_brightness_slider, PANEL_INACTIVE, iflag, NULL);
  xv_set(O1k_conf_avpanel_popup->avpanel_contrast_slider, PANEL_INACTIVE, iflag, NULL);  
  xv_set(O1k_conf_avpanel_popup->avpanel_hue_slider, PANEL_INACTIVE, iflag, NULL);
  xv_set(O1k_conf_avpanel_popup->avpanel_gainu_slider, PANEL_INACTIVE, iflag, NULL);
  xv_set(O1k_conf_avpanel_popup->avpanel_gainv_slider, PANEL_INACTIVE, iflag, NULL);
  xv_set(O1k_conf_avpanel_popup->avpanel_codecprops_button, PANEL_INACTIVE, iflag, NULL);
  
}

/*
 * Notify callback function for `audio_setting'.
 */
void
set_audio_format(Panel_item item, int value, Event *event)
{
  o1k_conf_setup_popup_objects *ip = (o1k_conf_setup_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  int iflag;
  
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	if (value == 6)
	{
		xv_set(O1k_conf_audio_popup->audio_popup, XV_SHOW, FALSE, NULL);
	}
	
	if (value == 1)
	{
		xv_set(O1k_conf_audio_popup->audio_channels_setting, PANEL_INACTIVE, TRUE, NULL);
	}
	
	if (value == 4)
	{
		xv_set(O1k_conf_audio_popup->audio_channels_setting, PANEL_INACTIVE, FALSE, NULL);
	}
	
	if (value == 3)
	{
		xv_set(O1k_conf_audio_popup->audio_channels_setting, PANEL_INACTIVE, FALSE, NULL);
	}
	
	if (value == 2)
	{
		xv_set(O1k_conf_audio_popup->audio_channels_setting, PANEL_INACTIVE, FALSE, NULL);
	}
	
	if (value == 0)
	{
		xv_set(O1k_conf_audio_popup->audio_channels_setting, PANEL_INACTIVE, FALSE, NULL);
	}
	
	if (value == 5)
	{
		xv_set(O1k_conf_audio_popup->audio_channels_setting, PANEL_INACTIVE, FALSE, NULL);
	}
	
	if (value == 1)
	{
		xv_set(O1k_conf_audio_popup->audio_sampling_rate_setting, PANEL_INACTIVE, TRUE, NULL);
	}
	
	if (value == 4)
	{
		xv_set(O1k_conf_audio_popup->audio_sampling_rate_setting, PANEL_INACTIVE, FALSE, NULL);
	}
	
	if (value == 3)
	{
		xv_set(O1k_conf_audio_popup->audio_sampling_rate_setting, PANEL_INACTIVE, FALSE, NULL);
	}
	
	if (value == 2)
	{
		xv_set(O1k_conf_audio_popup->audio_sampling_rate_setting, PANEL_INACTIVE, FALSE, NULL);
	}
	
	if (value == 0)
	{
		xv_set(O1k_conf_audio_popup->audio_sampling_rate_setting, PANEL_INACTIVE, FALSE, NULL);
	}
	
	if (value == 5)
	{
		xv_set(O1k_conf_audio_popup->audio_sampling_rate_setting, PANEL_INACTIVE, FALSE, NULL);
	}
	
	/* gxv_end_connections */
  
  conf->audio->setFormat((AudioType)value);
  
  if (value == AUD_NONE){
    iflag = TRUE;
  } else {
    iflag = FALSE;
  }
  xv_set(O1k_conf_avpanel_popup->audio_volume_slider, PANEL_INACTIVE, iflag, NULL);
  xv_set(O1k_conf_avpanel_popup->audio_gain_slider, PANEL_INACTIVE, iflag, NULL);
  xv_set(O1k_conf_avpanel_popup->audio_monitor_slider, PANEL_INACTIVE, iflag, NULL);
  xv_set(O1k_conf_avpanel_popup->avpanel_aud_inputsel_setting, PANEL_INACTIVE, iflag, NULL);
  xv_set(O1k_conf_avpanel_popup->audio_output_enable_setting, PANEL_INACTIVE, iflag, NULL);
  xv_set(O1k_conf_avpanel_popup->audio_input_enable_setting, PANEL_INACTIVE, iflag, NULL);

}

/*
 * Notify callback function for `audio_properties_b'.
 */
void
o1k_conf_setup_popup_audio_properties_b_notify_callback(Panel_item item, Event *event)
{
  o1k_conf_setup_popup_objects *ip = (o1k_conf_setup_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
	
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	xv_set(O1k_conf_audio_popup->audio_popup, XV_SHOW, TRUE, NULL);
	
	/* gxv_end_connections */

}

/*
 * Notify callback function for `setup_close_button'.
 */
void
o1k_conf_setup_popup_setup_close_button_notify_callback(Panel_item item, Event *event)
{
  o1k_conf_setup_popup_objects *ip = (o1k_conf_setup_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	xv_set(O1k_conf_setup_popup->setup_popup, FRAME_CMD_PUSHPIN_IN, FALSE, NULL);
	xv_set(O1k_conf_setup_popup->setup_popup, XV_SHOW, FALSE, NULL);
	
	xv_set(O1k_conf_audio_popup->audio_popup, XV_SHOW, FALSE, NULL);
	
	xv_set(O1k_conf_cellb_popup->cellb_popup, XV_SHOW, FALSE, NULL);
	
	xv_set(O1k_conf_h261_popup->h261_popup, XV_SHOW, FALSE, NULL);
	
	xv_set(O1k_conf_jpeg_popup->jpeg_popup, XV_SHOW, FALSE, NULL);
	
	/* gxv_end_connections */
  
}

/*
 * Notify callback function for `audio_channels_setting'.
 */
void
audio_set_channels(Panel_item item, int value, Event *event)
{
  o1k_conf_audio_popup_objects *ip = (o1k_conf_audio_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	/* gxv_end_connections */

  conf->audio->setChannels((AudioChannels)value);

}

/*
 * Notify callback function for `audio_sampling_rate_setting'.
 */
void
audio_set_samplerate(Panel_item item, int value, Event *event)
{
  o1k_conf_audio_popup_objects *ip = (o1k_conf_audio_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	/* gxv_end_connections */


  conf->audio->setSampleRate((AudioSampleRate)value);  
}

/*
 * Notify callback function for `audio_echo_suppress_setting'.
 */
void
audio_set_aes(Panel_item item, int value, Event *event)
{
  o1k_conf_audio_popup_objects *ip = (o1k_conf_audio_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
    
		/* gxv_start_connections DO NOT EDIT THIS SECTION */

		/* gxv_end_connections */
    
  conf->audio->setAES(value);
}

/*
 * Notify callback function for `audio_close_button'.
 */
void
o1k_conf_audio_popup_audio_close_button_notify_callback(Panel_item item, Event *event)
{
  o1k_conf_audio_popup_objects *ip = (o1k_conf_audio_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	xv_set(O1k_conf_audio_popup->audio_popup, XV_SHOW, FALSE, NULL);
	
	/* gxv_end_connections */
  
}

/*
 * Notify callback function for `cellb_cif_setting'.
 */
void
cellb_set_videosize(Panel_item item, int value, Event *event)
{
  o1k_conf_cellb_popup_objects *ip = (o1k_conf_cellb_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	/* gxv_end_connections */

  conf->video->setCellbSize((VideoSize)value);
}

/*
 * Notify callback function for `cellb_frame_rate_slider'.
 */
void
cellb_set_framerate(Panel_item item, int value, Event *event)
{
  o1k_conf_cellb_popup_objects *ip = (o1k_conf_cellb_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	/* gxv_end_connections */

  conf->video->setCellbFrameRate(value);
}

/*
 * Notify callback function for `cellb_close_button'.
 */
void
o1k_conf_cellb_popup_cellb_close_button_notify_callback(Panel_item item, Event *event)
{
  o1k_conf_cellb_popup_objects *ip = (o1k_conf_cellb_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	xv_set(O1k_conf_cellb_popup->cellb_popup, XV_SHOW, FALSE, NULL);
	
	/* gxv_end_connections */

}

/*
 * Notify callback function for `audio_volume_slider'.
 */
void
audio_set_voloutput(Panel_item item, int value, Event *event)
{
  o1k_conf_avpanel_popup_objects *ip = (o1k_conf_avpanel_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	/* gxv_end_connections */

  conf->audio->setVolOutput(value);
}

/*
 * Notify callback function for `audio_gain_slider'.
 */
void
audio_set_volinput(Panel_item item, int value, Event *event)
{
  o1k_conf_avpanel_popup_objects *ip = (o1k_conf_avpanel_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
	
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	/* gxv_end_connections */

  conf->audio->setVolInput(value);
  
}

/*
 * Notify callback function for `audio_volume_slider'.
 */
void
audio_set_volmonitor(Panel_item item, int value, Event *event)
{
  o1k_conf_avpanel_popup_objects *ip = (o1k_conf_avpanel_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	/* gxv_end_connections */

  conf->audio->setVolMonitor(value);  
}

/*
 * Notify callback function for `avpanel_aud_inputsel_setting'.
 */
void
audio_set_inputselect(Panel_item item, int value, Event *event)
{
  o1k_conf_avpanel_popup_objects *ip = (o1k_conf_avpanel_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	/* gxv_end_connections */
  conf->audio->setPort((AudioPort)value);
}

/*
 * Notify callback function for `avpanel_vid_inputsel_setting'.
 */
void
video_set_inputselect(Panel_item item, int value, Event *event)
{
  o1k_conf_avpanel_popup_objects *ip = (o1k_conf_avpanel_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
	
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	/* gxv_end_connections */
  conf->video->setInputPort((VideoPort)value);
}

/*
 * Notify callback function for `avpanel_brightness_slider'.
 */
void
video_set_brightness(Panel_item item, int value, Event *event)
{
  o1k_conf_avpanel_popup_objects *ip = (o1k_conf_avpanel_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);

	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	/* gxv_end_connections */

  conf->video->setBrightness(value);
}

/*
 * Notify callback function for `avpanel_contrast_slider'.
 */
void
video_set_contrast(Panel_item item, int value, Event *event)
{
  o1k_conf_avpanel_popup_objects *ip = (o1k_conf_avpanel_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
	
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	/* gxv_end_connections */

  conf->video->setContrast(value);
}

/*
 * Notify callback function for `avpanel_hue_slider'.
 */
void
video_set_hue(Panel_item item, int value, Event *event)
{
  o1k_conf_avpanel_popup_objects *ip = (o1k_conf_avpanel_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
	
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	/* gxv_end_connections */

  conf->video->setHue(value);
}

/*
 * Notify callback function for `avpanel_gainu_slider'.
 */
void
video_set_gainu(Panel_item item, int value, Event *event)
{
  o1k_conf_avpanel_popup_objects *ip = (o1k_conf_avpanel_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
	
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	/* gxv_end_connections */

  conf->video->setGainU(value);  
}

/*
 * Notify callback function for `avpanel_gainv_slider'.
 */
void
video_set_gainv(Panel_item item, int value, Event *event)
{
  o1k_conf_avpanel_popup_objects *ip = (o1k_conf_avpanel_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
	
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	/* gxv_end_connections */

  conf->video->setGainV(value);
}

/*
 * Notify callback function for `avpenel_reset_button'.
 */
void
reset_avpanel(Panel_item item, Event *event)
{
  o1k_conf_avpanel_popup_objects *ip = (o1k_conf_avpanel_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
	
	/* gxv_start_connections DO NOT EDIT THIS SECTION */
	/* gxv_end_connections */

}

/*
 * Notify callback function for `avpanel_close_button'.
 */
void
o1k_conf_avpanel_popup_avpanel_close_button_notify_callback(Panel_item item, Event *event)
{
  o1k_conf_avpanel_popup_objects *ip = (o1k_conf_avpanel_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	xv_set(O1k_conf_avpanel_popup->avpanel_popup, FRAME_CMD_PUSHPIN_IN, FALSE, NULL);
	xv_set(O1k_conf_avpanel_popup->avpanel_popup, XV_SHOW, FALSE, NULL);
	
	/* gxv_end_connections */

}

/*
 * Notify callback function for `avpanel_codecprops_button'.
 */
void
bringup_codec_properties(Panel_item item, Event *event)
{
  o1k_conf_avpanel_popup_objects *ip = (o1k_conf_avpanel_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  
  switch (conf->video->getFormat()){
    case H261:
    {
      xv_set(O1k_conf_h261_popup->h261_popup, XV_SHOW, TRUE, NULL);
      break;
    }
    case CELLB:
    {
      xv_set(O1k_conf_cellb_popup->cellb_popup, XV_SHOW, TRUE, NULL);
      break;
    }
    case JPEG:
    {
      xv_set(O1k_conf_jpeg_popup->jpeg_popup, XV_SHOW, TRUE, NULL);
      break;
    }
  }
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	/* gxv_end_connections */

}

/*
 * Notify callback function for `ab_delete_button'.
 */
void
ab_delete(Panel_item item, Event *event)
{
  o1k_conf_address_popup_objects *ip = (o1k_conf_address_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  char buf[O1K_AB_MAX_STRING];
  
  int selected = xv_get(O1k_conf_address_popup->list1, PANEL_LIST_FIRST_SELECTED);
  if (selected >= 0){
    strcpy(buf, (char*)xv_get(O1k_conf_address_popup->list1, PANEL_LIST_STRING, selected));
    conf->addressbook->delete_user(conf->addressbook->getSort(), buf);
    ab_show_select("");
    ab_relist();
  }
  
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	/* gxv_end_connections */
  
}

/*
 * Notify callback function for `ab_new_button'.
 */
void
ab_new(Panel_item item, Event *event)
{
  o1k_conf_address_popup_objects *ip = (o1k_conf_address_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  int selected;
  
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	xv_set(O1k_conf_address_popup->ab_sort_button, PANEL_INACTIVE, TRUE, NULL);
	
	xv_set(O1k_conf_address_popup->ab_delete_button, PANEL_INACTIVE, TRUE, NULL);
	
	xv_set(O1k_conf_address_popup->ab_new_button, PANEL_INACTIVE, TRUE, NULL);
	
	xv_set(O1k_conf_address_popup->ab_new_button, XV_SHOW, FALSE, NULL);
	
	xv_set(O1k_conf_address_popup->ab_add_button, PANEL_INACTIVE, FALSE, NULL);
	
	xv_set(O1k_conf_address_popup->ab_add_button, XV_SHOW, TRUE, NULL);
	
	xv_set(O1k_conf_address_popup->ab_cancel_button, PANEL_INACTIVE, FALSE, NULL);
	
	xv_set(O1k_conf_address_popup->ab_cancel_button, XV_SHOW, TRUE, NULL);
	
	xv_set(O1k_conf_address_popup->ab_done_button, PANEL_INACTIVE, TRUE, NULL);
	
	xv_set(O1k_conf_address_popup->ab_done_button, XV_SHOW, FALSE, NULL);
	
	/* gxv_end_connections */

  selected = xv_get(O1k_conf_address_popup->list1, PANEL_LIST_FIRST_SELECTED);
  if (selected >= 0)
    xv_set(O1k_conf_address_popup->list1, PANEL_LIST_SELECT, selected, FALSE, NULL);

  xv_set(O1k_conf_address_popup->ab_userhost_textfield,  PANEL_READ_ONLY, FALSE, NULL);
  xv_set(O1k_conf_address_popup->ab_firstname_textfield, PANEL_READ_ONLY, FALSE, NULL);
  xv_set(O1k_conf_address_popup->ab_lastname_textfield,  PANEL_READ_ONLY, FALSE, NULL);
  xv_set(O1k_conf_address_popup->ab_phone_textfield,     PANEL_READ_ONLY, FALSE, NULL);
  xv_set(O1k_conf_address_popup->ab_email_textfield,     PANEL_READ_ONLY, FALSE, NULL);
  
  xv_set(O1k_conf_address_popup->ab_userhost_textfield, PANEL_VALUE, "", NULL);
  xv_set(O1k_conf_address_popup->ab_firstname_textfield, PANEL_VALUE, "", NULL);
  xv_set(O1k_conf_address_popup->ab_lastname_textfield, PANEL_VALUE, "", NULL);
  xv_set(O1k_conf_address_popup->ab_phone_textfield, PANEL_VALUE, "", NULL);
  xv_set(O1k_conf_address_popup->ab_email_textfield, PANEL_VALUE, "", NULL);
  xv_set(O1k_conf_address_popup->ab_add_button, XV_SHOW, TRUE, NULL);
  xv_set(O1k_conf_address_popup->ab_cancel_button, XV_SHOW, TRUE, NULL);

}

/*
 * Notify callback function for `ab_add_button'.
 */
void
ab_add(Panel_item item, Event *event)
{
  o1k_conf_address_popup_objects *ip = (o1k_conf_address_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	xv_set(O1k_conf_address_popup->ab_new_button, PANEL_INACTIVE, FALSE, NULL);
	
	xv_set(O1k_conf_address_popup->ab_new_button, XV_SHOW, TRUE, NULL);
	
	xv_set(O1k_conf_address_popup->ab_sort_button, PANEL_INACTIVE, FALSE, NULL);
	
	xv_set(O1k_conf_address_popup->ab_delete_button, PANEL_INACTIVE, FALSE, NULL);
	
	xv_set(O1k_conf_address_popup->ab_add_button, PANEL_INACTIVE, TRUE, NULL);
	
	xv_set(O1k_conf_address_popup->ab_add_button, XV_SHOW, FALSE, NULL);
	
	xv_set(O1k_conf_address_popup->ab_cancel_button, PANEL_INACTIVE, TRUE, NULL);
	
	xv_set(O1k_conf_address_popup->ab_cancel_button, XV_SHOW, FALSE, NULL);
	
	xv_set(O1k_conf_address_popup->ab_done_button, PANEL_INACTIVE, FALSE, NULL);
	
	xv_set(O1k_conf_address_popup->ab_done_button, XV_SHOW, TRUE, NULL);
	
	/* gxv_end_connections */

  xv_set(O1k_conf_address_popup->ab_userhost_textfield,  PANEL_READ_ONLY, TRUE, NULL);
  xv_set(O1k_conf_address_popup->ab_firstname_textfield, PANEL_READ_ONLY, TRUE, NULL);
  xv_set(O1k_conf_address_popup->ab_lastname_textfield,  PANEL_READ_ONLY, TRUE, NULL);
  xv_set(O1k_conf_address_popup->ab_phone_textfield,     PANEL_READ_ONLY, TRUE, NULL);
  xv_set(O1k_conf_address_popup->ab_email_textfield,     PANEL_READ_ONLY, TRUE, NULL);
  
  xv_set(O1k_conf_address_popup->ab_done_button, XV_SHOW, TRUE, NULL);
  xv_set(O1k_conf_address_popup->ab_new_button, XV_SHOW, TRUE, NULL);
  conf->addressbook->add_user((char*)xv_get(O1k_conf_address_popup->ab_firstname_textfield, PANEL_VALUE),
                              (char*)xv_get(O1k_conf_address_popup->ab_lastname_textfield,  PANEL_VALUE),
                              (char*)xv_get(O1k_conf_address_popup->ab_email_textfield,     PANEL_VALUE),
                              (char*)xv_get(O1k_conf_address_popup->ab_phone_textfield,     PANEL_VALUE),
                              (char*)xv_get(O1k_conf_address_popup->ab_userhost_textfield,  PANEL_VALUE));

  ab_relist();
}

/*
 * Notify callback function for `ab_cancel_button'.
 */
void
o1k_conf_address_popup_ab_cancel_button_notify_callback(Panel_item item, Event *event)
{
  o1k_conf_address_popup_objects *ip = (o1k_conf_address_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	xv_set(O1k_conf_address_popup->ab_add_button, PANEL_INACTIVE, TRUE, NULL);
	
	xv_set(O1k_conf_address_popup->ab_add_button, XV_SHOW, FALSE, NULL);
	
	xv_set(O1k_conf_address_popup->ab_new_button, PANEL_INACTIVE, FALSE, NULL);
	
	xv_set(O1k_conf_address_popup->ab_new_button, XV_SHOW, TRUE, NULL);
	
	xv_set(O1k_conf_address_popup->ab_delete_button, PANEL_INACTIVE, FALSE, NULL);
	
	xv_set(O1k_conf_address_popup->ab_sort_button, PANEL_INACTIVE, FALSE, NULL);
	
	xv_set(O1k_conf_address_popup->ab_cancel_button, PANEL_INACTIVE, TRUE, NULL);
	
	xv_set(O1k_conf_address_popup->ab_cancel_button, XV_SHOW, FALSE, NULL);
	
	xv_set(O1k_conf_address_popup->ab_done_button, PANEL_INACTIVE, FALSE, NULL);
	
	xv_set(O1k_conf_address_popup->ab_done_button, XV_SHOW, TRUE, NULL);
	
	/* gxv_end_connections */

  xv_set(O1k_conf_address_popup->ab_userhost_textfield,  PANEL_READ_ONLY, TRUE, NULL);
  xv_set(O1k_conf_address_popup->ab_firstname_textfield, PANEL_READ_ONLY, TRUE, NULL);
  xv_set(O1k_conf_address_popup->ab_lastname_textfield,  PANEL_READ_ONLY, TRUE, NULL);
  xv_set(O1k_conf_address_popup->ab_phone_textfield,     PANEL_READ_ONLY, TRUE, NULL);
  xv_set(O1k_conf_address_popup->ab_email_textfield,     PANEL_READ_ONLY, TRUE, NULL);
  
  xv_set(O1k_conf_address_popup->ab_done_button, XV_SHOW, TRUE, NULL);
  xv_set(O1k_conf_address_popup->ab_new_button, XV_SHOW, TRUE, NULL);

}

/*
 * Notify callback function for `ab_done_button'.
 */
void
o1k_conf_address_popup_ab_done_button_notify_callback(Panel_item item, Event *event)
{
  o1k_conf_address_popup_objects *ip = (o1k_conf_address_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	xv_set(O1k_conf_address_popup->address_popup, FRAME_CMD_PUSHPIN_IN, FALSE, NULL);
	xv_set(O1k_conf_address_popup->address_popup, XV_SHOW, FALSE, NULL);
	
	/* gxv_end_connections */
  
  xv_set(O1k_conf_main_window->main_user_tf, PANEL_VALUE, 
         xv_get(O1k_conf_address_popup->ab_userhost_textfield,  PANEL_VALUE), NULL);
  xv_set(O1k_conf_main_window->call_b, PANEL_INACTIVE, FALSE, NULL);
  if (conf->state == CONF_IDLE)
    conf->network->setUserHost((char*)xv_get(O1k_conf_address_popup->ab_userhost_textfield,  PANEL_VALUE));
}

/*
 * Notify callback function for `h261_cif_setting'.
 */
void
h261_set_videosize(Panel_item item, int value, Event *event)
{
  o1k_conf_h261_popup_objects *ip = (o1k_conf_h261_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	/* gxv_end_connections */

  conf->video->setH261Size((VideoSize)value);
}

/*
 * Notify callback function for `h261_pip_setting'.
 */
void
h261_set_pip(Panel_item item, int value, Event *event)
{
  o1k_conf_h261_popup_objects *ip = (o1k_conf_h261_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
    
		/* gxv_start_connections DO NOT EDIT THIS SECTION */

		/* gxv_end_connections */

  conf->video->setH261Pip(value);
}

/*
 * Notify callback function for `h261_bitrate_slider'.
 */
void
h261_set_bitrate(Panel_item item, int value, Event *event)
{
  o1k_conf_h261_popup_objects *ip = (o1k_conf_h261_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
	
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	/* gxv_end_connections */

  conf->video->setH261BitRate(value);
}

/*
 * Notify callback function for `h261_quant_slider'.
 */
void
h261_set_maxquant(Panel_item item, int value, Event *event)
{
  o1k_conf_h261_popup_objects *ip = (o1k_conf_h261_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
	
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	/* gxv_end_connections */
  
  conf->video->setH261MaxQuant(value);
}

/*
 * Notify callback function for `h261_frame_rate_slider'.
 */
void
h261_set_framerate(Panel_item item, int value, Event *event)
{
  o1k_conf_h261_popup_objects *ip = (o1k_conf_h261_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);

	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	/* gxv_end_connections */

  conf->video->setH261FrameRate(value);
}

/*
 * Notify callback function for `h261_refresh_slider'.
 */
void
h261_set_refresh(Panel_item item, int value, Event *event)
{
  o1k_conf_h261_popup_objects *ip = (o1k_conf_h261_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	/* gxv_end_connections */

  conf->video->setH261RefreshPeriod(value);
}

/*
 * Notify callback function for `h261_close_button'.
 */
void
o1k_conf_h261_popup_h261_close_button_notify_callback(Panel_item item, Event *event)
{
  o1k_conf_h261_popup_objects *ip = (o1k_conf_h261_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	xv_set(O1k_conf_h261_popup->h261_popup, XV_SHOW, FALSE, NULL);
	
	/* gxv_end_connections */

}

/*
 * Notify callback function for `status_setting'.
 */
void
status_set_select(Panel_item item, unsigned int value, Event *event)
{

  o1k_conf_status_popup_objects *ip = (o1k_conf_status_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  short	i;
  int mask = 0x0;
  int ypos = 0;
  int final_height;
  
#define STVM 0x1
#define STAM 0x2
#define STNM 0x4
  
  for (i = 0; i < 3; i++) {
    if (value & 01){
      mask |= (1 << i);
    }
		/* gxv_start_connections DO NOT EDIT THIS SECTION */

		/* gxv_end_connections */
    
    value >>= 1;
  }
  
  xv_set(O1k_conf_status_popup->status_video_controls,   XV_HEIGHT, vh, NULL);
  xv_set(O1k_conf_status_popup->status_audio_controls,   XV_HEIGHT, ah, NULL);
  xv_set(O1k_conf_status_popup->status_network_controls, XV_HEIGHT, nh, NULL);
  xv_set(O1k_conf_status_popup->status_controls,         XV_HEIGHT, ch, NULL);     

  
  ypos = (int)xv_get(O1k_conf_status_popup->status_controls, XV_Y) +
         (int)xv_get(O1k_conf_status_popup->status_controls, XV_HEIGHT);

  final_height = ch;
  
  if (mask&STVM){
    /* show video controls */
    xv_set(O1k_conf_status_popup->status_video_controls, XV_Y, ypos, NULL);
    xv_set(O1k_conf_status_popup->status_video_controls, XV_SHOW, TRUE, NULL);

    ypos = (int)xv_get(O1k_conf_status_popup->status_video_controls, XV_Y) +
           (int)xv_get(O1k_conf_status_popup->status_video_controls, XV_HEIGHT);

    final_height += vh;
  } else {
    xv_set(O1k_conf_status_popup->status_video_controls, XV_SHOW, FALSE, NULL);
  }

  if (mask&STAM){
    /* show audio controls */
    xv_set(O1k_conf_status_popup->status_audio_controls, XV_Y, ypos, NULL);
    xv_set(O1k_conf_status_popup->status_audio_controls, XV_SHOW, TRUE, NULL);

    ypos = (int)xv_get(O1k_conf_status_popup->status_audio_controls, XV_Y) +
           (int)xv_get(O1k_conf_status_popup->status_audio_controls, XV_HEIGHT);

    final_height += ah;    
  } else {
    xv_set(O1k_conf_status_popup->status_audio_controls, XV_SHOW, FALSE, NULL);
  }

  if (mask&STNM){
    /* show network controls */
    xv_set(O1k_conf_status_popup->status_network_controls, XV_Y, ypos, NULL);
    xv_set(O1k_conf_status_popup->status_network_controls, XV_SHOW, TRUE, NULL);

    ypos = (int)xv_get(O1k_conf_status_popup->status_network_controls, XV_Y) +
           (int)xv_get(O1k_conf_status_popup->status_network_controls, XV_HEIGHT);

    final_height += nh;        
  } else {
    xv_set(O1k_conf_status_popup->status_network_controls, XV_SHOW, FALSE, NULL);
  }

  xv_set(O1k_conf_status_popup->status_popup, XV_HEIGHT, final_height, NULL);

}

/*
 * Notify callback function for `audio_output_enable_setting'.
 */
void
set_audio_output_enable(Panel_item item, int value, Event *event)
{
  o1k_conf_avpanel_popup_objects *ip = (o1k_conf_avpanel_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
    
		/* gxv_start_connections DO NOT EDIT THIS SECTION */

		/* gxv_end_connections */

  conf->audio->setEnableOutput(value);    
}

/*
 * Notify callback function for `audio_input_enable_setting'.
 */
void
set_audio_input_enable(Panel_item item, int value, Event *event)
{
  o1k_conf_avpanel_popup_objects *ip = (o1k_conf_avpanel_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  
		/* gxv_start_connections DO NOT EDIT THIS SECTION */

		/* gxv_end_connections */

  conf->audio->setEnableInput(value);  
}

/*
 * Notify callback function for `main_user_tf'.
 */
Panel_setting
set_address(Panel_item item, Event *event)
{
  o1k_conf_main_window_objects *ip = (o1k_conf_main_window_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  char *	value = (char *) xv_get(item, PANEL_VALUE);
  
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	/* gxv_end_connections */

  if (conf->state == CONF_IDLE){
    conf->network->setUserHost(value);
    xv_set(O1k_conf_main_window->call_b, PANEL_INACTIVE, FALSE, NULL);
  }
  
  return panel_text_notify(item, event);
}

/*
 * Notify callback function for `video_properties_b'.
 */
void
setup_show_video_props(Panel_item item, Event *event)
{
  o1k_conf_setup_popup_objects *ip = (o1k_conf_setup_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	/* gxv_end_connections */

  switch (conf->video->getFormat()){
    case H261:
    {
      xv_set(O1k_conf_h261_popup->h261_popup, XV_SHOW, TRUE, NULL);
      break;
    }
    case CELLB:
    {
      xv_set(O1k_conf_cellb_popup->cellb_popup, XV_SHOW, TRUE, NULL);
      break;
    }
    case JPEG:
    {
      xv_set(O1k_conf_jpeg_popup->jpeg_popup, XV_SHOW, TRUE, NULL);
      break;
    }
  }
}

/*
 * Menu handler for `ab_sort_menu (User)'.
 */
Menu_item
ab_sort_user(Menu_item item, Menu_generate op)
{
	o1k_conf_address_popup_objects * ip = (o1k_conf_address_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
	
	switch (op) {
	case MENU_DISPLAY:
		break;

	case MENU_DISPLAY_DONE:
		break;

	case MENU_NOTIFY:
                conf->addressbook->sort(SORT_USER);
                ab_relist();
		/* gxv_start_connections DO NOT EDIT THIS SECTION */

		/* gxv_end_connections */

		break;

	case MENU_NOTIFY_DONE:
		break;
	}
	return item;
}

/*
 * Menu handler for `ab_sort_menu (First)'.
 */
Menu_item
ab_sort_first(Menu_item item, Menu_generate op)
{
	o1k_conf_address_popup_objects * ip = (o1k_conf_address_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
	
	switch (op) {
	case MENU_DISPLAY:
		break;

	case MENU_DISPLAY_DONE:
		break;

	case MENU_NOTIFY:
                conf->addressbook->sort(SORT_FIRST);
                ab_relist();
		/* gxv_start_connections DO NOT EDIT THIS SECTION */

		/* gxv_end_connections */

		break;

	case MENU_NOTIFY_DONE:
		break;
	}
	return item;
}

/*
 * Menu handler for `ab_sort_menu (Last)'.
 */
Menu_item
ab_sort_last(Menu_item item, Menu_generate op)
{
	o1k_conf_address_popup_objects * ip = (o1k_conf_address_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
	
	switch (op) {
	case MENU_DISPLAY:
		break;

	case MENU_DISPLAY_DONE:
		break;

	case MENU_NOTIFY:
                conf->addressbook->sort(SORT_LAST);
                ab_relist();
		/* gxv_start_connections DO NOT EDIT THIS SECTION */

		/* gxv_end_connections */

		break;

	case MENU_NOTIFY_DONE:
		break;
	}
	return item;
}

/*
 * Menu handler for `ab_sort_menu (Email)'.
 */
Menu_item
ab_sort_email(Menu_item item, Menu_generate op)
{
	o1k_conf_address_popup_objects * ip = (o1k_conf_address_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
	
	switch (op) {
	case MENU_DISPLAY:
		break;

	case MENU_DISPLAY_DONE:
		break;

	case MENU_NOTIFY:
                conf->addressbook->sort(SORT_EMAIL);
                ab_relist();
		/* gxv_start_connections DO NOT EDIT THIS SECTION */

		/* gxv_end_connections */

		break;

	case MENU_NOTIFY_DONE:
		break;
	}
	return item;
}

/*
 * Notify callback function for `join_yes_button'.
 */
void
joing_accept_call(Panel_item item, Event *event)
{
  o1k_conf_join_popup_objects *ip = (o1k_conf_join_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	xv_set(O1k_conf_join_popup->join_popup, XV_SHOW, FALSE, NULL);
	
	/* gxv_end_connections */
  
  xv_set(O1k_conf_main_window->setup_b, PANEL_INACTIVE, TRUE, NULL);
  if (xv_get(O1k_conf_main_window->main_window, FRAME_CLOSED))
    xv_set(O1k_conf_main_window->main_window, FRAME_CLOSED, FALSE, NULL);
  xv_set(O1k_conf_main_window->main_window, XV_SHOW, TRUE, NULL);
  xv_set(O1k_conf_main_window->main_window, FRAME_LEFT_FOOTER, "Joining", NULL);
  xv_set(O1k_conf_main_window->hangup_b, PANEL_INACTIVE, FALSE, NULL);
  xv_set(O1k_conf_main_window->hangup_b, XV_SHOW, TRUE, NULL);
  xv_set(O1k_conf_main_window->call_b, XV_SHOW, FALSE, NULL);
  xv_set(O1k_conf_main_window->call_b, PANEL_INACTIVE, TRUE, NULL);
  xv_set(O1k_conf_setup_popup->setup_popup, FRAME_CMD_PUSHPIN_IN, FALSE, NULL);
  xv_set(O1k_conf_setup_popup->setup_popup, XV_SHOW, FALSE, NULL);
  xv_set(O1k_conf_audio_popup->audio_popup, XV_SHOW, FALSE, NULL);
  xv_set(O1k_conf_cellb_popup->cellb_popup, XV_SHOW, FALSE, NULL);
  xv_set(O1k_conf_jpeg_popup->jpeg_popup, XV_SHOW, FALSE, NULL);
  xv_set(O1k_conf_h261_popup->h261_popup, XV_SHOW, FALSE, NULL);
  xv_set(O1k_conf_main_window->hangup_b, XV_SHOW, TRUE, NULL);
  xv_set(O1k_conf_avpanel_popup->avpanel_vid_outputsel_setting, PANEL_INACTIVE, TRUE, NULL);  
  conf->network->setUserHost(conf->incoming_call.source);
  xv_set(O1k_conf_main_window->main_user_tf, PANEL_VALUE, conf->incoming_call.source, NULL);  
  conf->joinAccept();
}

/*
 * Notify callback function for `join_no_button'.
 */
void
join_deny_call(Panel_item item, Event *event)
{
  o1k_conf_join_popup_objects *ip = (o1k_conf_join_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	xv_set(O1k_conf_join_popup->join_popup, XV_SHOW, FALSE, NULL);
	
	/* gxv_end_connections */


  conf->joinDeny();
}

void timeout_common()
{
  xv_set(O1k_conf_main_window->main_window, FRAME_LEFT_FOOTER, "Hanging Up", NULL);
  xv_set(O1k_conf_main_window->setup_b, PANEL_INACTIVE, FALSE, NULL);
  if (xv_get(O1k_conf_main_window->main_window, FRAME_CLOSED))
    xv_set(O1k_conf_main_window->main_window, FRAME_CLOSED, FALSE, NULL);
  xv_set(O1k_conf_main_window->main_window, XV_SHOW, TRUE, NULL);
  xv_set(O1k_conf_main_window->hangup_b, XV_SHOW, FALSE, NULL);
  xv_set(O1k_conf_main_window->hangup_b, PANEL_INACTIVE, TRUE, NULL);
  xv_set(O1k_conf_avpanel_popup->avpanel_vid_outputsel_setting, PANEL_INACTIVE, FALSE, NULL);    
  xv_set(O1k_conf_main_window->call_b, XV_SHOW, TRUE, NULL);
  xv_set(O1k_conf_main_window->call_b, PANEL_INACTIVE, FALSE, NULL);
  xv_set(O1k_conf_main_window->call_b, XV_SHOW, TRUE, NULL);
  xv_set(O1k_conf_main_window->main_window, FRAME_LEFT_FOOTER, "", NULL);
}

Notify_value control_func(...)
{
  int rc = conf->checkControl();

  switch (rc){
    case CNTRL_NONE: break;
    case CNTRL_CALLING:
    {
      char buf[20];
            
      xv_set(O1k_conf_join_popup->join_userhost_tf,        PANEL_VALUE, conf->incoming_call.source, NULL);
      xv_set(O1k_conf_join_popup->join_audio_type_tf,      PANEL_VALUE, AudioTypeStr[conf->incoming_call.atype], NULL);
      if (conf->incoming_call.atype == G728 || conf->incoming_call.atype == AUD_NONE){
        strcpy(buf, "N/A");
        xv_set(O1k_conf_join_popup->join_audio_channels_tf,  PANEL_VALUE, buf, NULL);
        xv_set(O1k_conf_join_popup->join_audio_samples_tf,   PANEL_VALUE, buf, NULL);
      } else {
        xv_set(O1k_conf_join_popup->join_audio_channels_tf,  PANEL_VALUE, AudioChannelsStr[conf->incoming_call.channels], NULL);
        xv_set(O1k_conf_join_popup->join_audio_samples_tf,   PANEL_VALUE, AudioSampleRateStr[conf->incoming_call.sample_rate], NULL);
      }
      xv_set(O1k_conf_join_popup->join_video_type_tf,      PANEL_VALUE, VideoTypeStr[conf->incoming_call.vtype], NULL);
      if (conf->incoming_call.vtype == VID_NONE){
        strcpy(buf, "N/A");
        xv_set(O1k_conf_join_popup->join_video_size_tf,      PANEL_VALUE, buf, NULL);
        xv_set(O1k_conf_join_popup->join_video_framerate_tf, PANEL_VALUE, buf, NULL);
      } else {
        xv_set(O1k_conf_join_popup->join_video_size_tf,      PANEL_VALUE, VideoSizeStr[conf->incoming_call.size], NULL);
        sprintf(buf, "%d fps",conf->incoming_call.framerate);
        xv_set(O1k_conf_join_popup->join_video_framerate_tf, PANEL_VALUE, buf, NULL);
      }
      xv_set(O1k_conf_join_popup->join_popup, XV_SHOW, TRUE, NULL);
      break;
    }
    case CNTRL_TIMEOUT:
    {
      xv_set(O1k_conf_main_window->main_window, FRAME_LEFT_FOOTER, "Call Timed Out", NULL);
      /* in case of looping */
      xv_set(O1k_conf_join_popup->join_popup, XV_SHOW, FALSE, NULL);
      if (conf->loop_mode){
        xv_set(O1k_conf_call_timeout_popup->call_timeout_popup, XV_SHOW, TRUE, NULL);
      } else {
        if (conf->state == CONF_RECEIVED_CALL){
          /* if we received call, just timeout */
          timeout_common();
        } else {
          /* if we sent call, put up popup */
          xv_set(O1k_conf_call_timeout_popup->call_timeout_popup, XV_SHOW, TRUE, NULL);
        }
      }
      conf->callTimedout();
      break;
    }
    case CNTRL_ACCEPTED:
    {
      /* far end accepted call */
      xv_set(O1k_conf_main_window->main_window, FRAME_LEFT_FOOTER, "In Conference", NULL);
      conf->callAccepted();
      break;
    }
    case CNTRL_HANGUP:
    {
      xv_set(O1k_conf_main_window->main_window, FRAME_LEFT_FOOTER, "Far End Hanging Up", NULL);
      xv_set(O1k_conf_main_window->setup_b, PANEL_INACTIVE, FALSE, NULL);
      if (xv_get(O1k_conf_main_window->main_window, FRAME_CLOSED))
        xv_set(O1k_conf_main_window->main_window, FRAME_CLOSED, FALSE, NULL);
      xv_set(O1k_conf_main_window->main_window, XV_SHOW, TRUE, NULL);
      xv_set(O1k_conf_main_window->hangup_b, XV_SHOW, FALSE, NULL);
      xv_set(O1k_conf_main_window->hangup_b, PANEL_INACTIVE, TRUE, NULL);
      xv_set(O1k_conf_avpanel_popup->avpanel_vid_outputsel_setting, PANEL_INACTIVE, FALSE, NULL);    
      xv_set(O1k_conf_main_window->call_b, XV_SHOW, TRUE, NULL);
      xv_set(O1k_conf_main_window->call_b, PANEL_INACTIVE, FALSE, NULL);
      xv_set(O1k_conf_main_window->call_b, XV_SHOW, TRUE, NULL);
      xv_set(O1k_conf_h261_popup->h261_cif_setting, PANEL_INACTIVE, FALSE, NULL);
      xv_set(O1k_conf_cellb_popup->cellb_cif_setting, PANEL_INACTIVE, FALSE, NULL);
      xv_set(O1k_conf_jpeg_popup->jpeg_cif_setting, PANEL_INACTIVE, FALSE, NULL);
      
      conf->hangup();
      xv_set(O1k_conf_main_window->main_window, FRAME_LEFT_FOOTER, "", NULL);     
    }
  }

  /*
   * Update Status Information
   */
  if (xv_get(O1k_conf_status_popup->status_popup, XV_SHOW)){
    xv_set(O1k_conf_status_popup->status_vt_br_textfield, PANEL_VALUE, conf->video->getStatus(VS_BITRATE_T), NULL);
    xv_set(O1k_conf_status_popup->status_vr_br_textfield, PANEL_VALUE, conf->video->getStatus(VS_BITRATE_R), NULL);
    xv_set(O1k_conf_status_popup->status_vt_fr_textfield, PANEL_VALUE, conf->video->getStatus(VS_FRAMERATE_T), NULL);
    xv_set(O1k_conf_status_popup->status_vr_fr_textfield, PANEL_VALUE, conf->video->getStatus(VS_FRAMERATE_R), NULL);
    
    xv_set(O1k_conf_status_popup->status_at_br_textfield, PANEL_VALUE, conf->audio->getStatus(AS_BITRATE_T), NULL);
    xv_set(O1k_conf_status_popup->status_ar_br_textfield, PANEL_VALUE, conf->audio->getStatus(AS_BITRATE_R), NULL);
    
    xv_set(O1k_conf_status_popup->status_nt_vp_textfield, PANEL_VALUE, conf->network->getStatus(NS_PACKETS_VT), NULL);
    xv_set(O1k_conf_status_popup->status_nt_ap_textfield, PANEL_VALUE, conf->network->getStatus(NS_PACKETS_AT), NULL);
    xv_set(O1k_conf_status_popup->status_nr_vp_textfield, PANEL_VALUE, conf->network->getStatus(NS_PACKETS_VR), NULL);
    xv_set(O1k_conf_status_popup->status_nr_ap_textfield, PANEL_VALUE, conf->network->getStatus(NS_PACKETS_AR), NULL);
    xv_set(O1k_conf_status_popup->status_n_vd_textfield,  PANEL_VALUE, conf->network->getStatus(NS_DROPS_V), NULL);
    xv_set(O1k_conf_status_popup->status_n_ad_textfield,  PANEL_VALUE, conf->network->getStatus(NS_DROPS_A), NULL);  
  }

  return NOTIFY_DONE;
}

/*
 * Notify callback function for `call_timeout_button'.
 */
void
o1k_conf_call_timeout_popup_call_timeout_button_notify_callback(Panel_item item, Event *event)
{
  o1k_conf_call_timeout_popup_objects *ip = (o1k_conf_call_timeout_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);

	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	xv_set(O1k_conf_call_timeout_popup->call_timeout_popup, XV_SHOW, FALSE, NULL);
	
	/* gxv_end_connections */
  timeout_common();
  
}

/*
 * Notify callback function for `list1'.
 */
int
ab_select(Panel_item item, char *string, Xv_opaque client_data, Panel_list_op op, Event *event, int row)
{
	o1k_conf_address_popup_objects *ip = (o1k_conf_address_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
	
	switch(op) {
	case PANEL_LIST_OP_DESELECT:
                ab_show_select("");
                break;

	case PANEL_LIST_OP_SELECT:
                ab_show_select(string);
		break;

	case PANEL_LIST_OP_VALIDATE:
		break;

	case PANEL_LIST_OP_DELETE:
		break;
	}
	
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	/* gxv_end_connections */

	return XV_OK;
}

/*
 * Notify callback function for `avpanel_vid_outputsel_setting'.
 */
void
video_set_outputselect(Panel_item item, int value, Event *event)
{
  o1k_conf_avpanel_popup_objects *ip = (o1k_conf_avpanel_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
	
  conf->video->setOutput((VideoOutput)value);  
	
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	/* gxv_end_connections */

}

/*
 * Notify callback function for `jpeg_cif_setting'.
 */
void
jpeg_set_videosize(Panel_item item, int value, Event *event)
{
  o1k_conf_jpeg_popup_objects *ip = (o1k_conf_jpeg_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	/* gxv_end_connections */
  conf->video->setJpegSize((VideoSize)value);
}

/*
 * Notify callback function for `jpeg_frame_rate_slider'.
 */
void
jpeg_set_framerate(Panel_item item, int value, Event *event)
{
  o1k_conf_jpeg_popup_objects *ip = (o1k_conf_jpeg_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	/* gxv_end_connections */
  conf->video->setJpegFrameRate(value);
}

/*
 * Notify callback function for `jpeg_quality_slider'.
 */
void
jpeg_set_quality(Panel_item item, int value, Event *event)
{
  o1k_conf_jpeg_popup_objects *ip = (o1k_conf_jpeg_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	/* gxv_end_connections */
  conf->video->setJpegQuality(value);
}

/*
 * Notify callback function for `jpeg_close_button'.
 */
void
o1k_conf_jpeg_popup_jpeg_close_button_notify_callback(Panel_item item, Event *event)
{
  o1k_conf_jpeg_popup_objects *ip = (o1k_conf_jpeg_popup_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  
	/* gxv_start_connections DO NOT EDIT THIS SECTION */

	xv_set(O1k_conf_jpeg_popup->jpeg_popup, XV_SHOW, FALSE, NULL);
	
	/* gxv_end_connections */

}
