Пример #1
0
MP MP::new_file( QString name, MP model ) {
    MP res = new_obj( "File" );
    res[ "name" ] = name;
    res[ "_ptr" ] = new_ptr( model );
    res[ "_info" ] = new_obj();
    return res;
}
Пример #2
0
ModelPointer ModelPointer::new_file( QString name, ModelPointer model ) {
    ModelPointer res = new_obj( "File" );
    res[ "name" ] = name;
    res[ "_ptr" ] = new_ptr( model );
    res[ "_info" ] = new_obj();
    return res;
}
Пример #3
0
void * ulRTTITypeinfo::create ( const ulRTTITypeinfo* bt, const char *c ) const
/*
  Tries to create an obj of type-name given by char*. Searches for this type
  in the type-DAG rooted by this, creates it and returns it as cast to 'bt',
  where bt is either this or a direct base of this.
*/
{
  void *p = NULL ; int i ;

  if ( !strcmp ( c, n ) ) /* Want to create an obj of this type ? */
    /* Yes, do it if this type is instantiable. */
    p = (new_obj) ? new_obj () : 0 ;
  else  /* No, try with subclasses... */
    for ( i = 0 ; i < ns &&
          !( ( p = subtypes[i]->create ( this, c ) ) ) ; i++ ) ;
  /* Succeeded creating on ith subclass branch ? */
  if ( !p ) return 0 ; /* Couldn't create it in any way, abort. */
  if ( bt == this )
    i = -1 ; /* Must cast to this's own type (i==-1) */
  else
    /* Search to which base of this we should cast */
    for ( i = 0 ; b[i] && b[i] != bt ; i++ ) ;

   /* Found: cast to ith base of this */
   return cast(i,p) ; /* Cast to ith base of to this, return as void* */
}
Пример #4
0
void place_sprite(sprite_t *s, camera_t *c) {
	bool exist = s->obj != NULL;
	int screen_x = SCREEN_X(*s, *c);
	int screen_y = SCREEN_Y(*s, *c);
	
	ENGINE_DEBUGFMT("sprite in world at %d, %d on screen at %d, %d, exist: %d, height: %d", s->x, s->height, screen_x, screen_y, exist, SPRITE_HEIGHT(*s));
	
	if ((screen_y + SPRITE_HEIGHT(*s) < 0) ||
	    (screen_y > SCREEN_HEIGHT) ||
	    (screen_x + SPRITE_WIDTH(*s) < 0) ||
	    (screen_x > SCREEN_WIDTH)) {
		if (exist) {
			ENGINE_DEBUG("sprite left! deleting it");
			delete_sprite(s);
		}
		return;
	} else {
		if (!exist) {
			ENGINE_DEBUG("sprite on screen and needs to be created");
			s->obj = new_obj();
		}
	}
	obj_set_attr(s->obj,
	             s->shape | ATTR0_REG,
	             s->size,
	             ATTR2_PALBANK(s->palbank) | s->tile);
	obj_set_pos(s->obj, screen_x, screen_y);
}
Пример #5
0
boost::shared_ptr<::google::protobuf::Message> ParseFromStr(const string& messageType, const string& message) {
    const ::google::protobuf::Descriptor* descriptor = ::google::protobuf::DescriptorPool::generated_pool()->FindMessageTypeByName(messageType);
    const ::google::protobuf::Message* prototype = ::google::protobuf::MessageFactory::generated_factory()->GetPrototype(descriptor);
    boost::shared_ptr<::google::protobuf::Message> new_obj(prototype->New());
    new_obj->ParseFromString(message);
    return new_obj;
}
Пример #6
0
Файл: obj.c Проект: qstemper/42
void			duplicate_obj(t_obj *obj)
{
	t_obj		*obj_crea;

	obj_crea = new_obj(OBJ_SPHERE);
	ft_memcpy(obj_crea, obj, sizeof(t_obj));
	add_obj(env->e_scene.scene, obj crea);
	e->frame.scene_refresh = clock();
}
Пример #7
0
T *conf_create(pool_t *mpool)
{
     T *thiz = new_obj(mpool, sizeof(*thiz));
     if (thiz == NULL) return NULL;

     _init(thiz);

     return thiz;           
}
Пример #8
0
T *btree_create(pool_t *mpool)
{
    T *thiz = new_obj(mpool, sizeof(*thiz) + sizeof(*SELF));
    if (thiz == NULL) return NULL;

    SELF = (typeof(SELF))((char *)thiz + sizeof(*thiz));

    _init(thiz);

    return thiz;           
}
Пример #9
0
/* classes.tuple uses this to reshape tuples; tools.deploy.shaker uses this
   to coalesce equal but distinct quotations and wrappers. */
void factor_vm::primitive_become()
{
	array *new_objects = untag_check<array>(ctx->pop());
	array *old_objects = untag_check<array>(ctx->pop());

	cell capacity = array_capacity(new_objects);
	if(capacity != array_capacity(old_objects))
		critical_error("bad parameters to become",0);

	/* Build the forwarding map */
	std::map<object *,object *> become_map;

	for(cell i = 0; i < capacity; i++)
	{
		tagged<object> old_obj(array_nth(old_objects,i));
		tagged<object> new_obj(array_nth(new_objects,i));

		if(old_obj != new_obj)
			become_map[old_obj.untagged()] = new_obj.untagged();
	}

	/* Update all references to old objects to point to new objects */
	{
		slot_visitor<slot_become_fixup> workhorse(this,slot_become_fixup(&become_map));
		workhorse.visit_roots();
		workhorse.visit_contexts();

		object_become_visitor object_visitor(&workhorse);
		each_object(object_visitor);

		code_block_become_visitor code_block_visitor(&workhorse);
		each_code_block(code_block_visitor);
	}

	/* Since we may have introduced old->new references, need to revisit
	all objects and code blocks on a minor GC. */
	data->mark_all_cards();

	{
		code_block_write_barrier_visitor code_block_visitor(code);
		each_code_block(code_block_visitor);
	}
}
Пример #10
0
Файл: parser.c Проект: fave-r/RT
void		fill_list(char **tmp, t_flag tab[], t_obj *obj, t_spot *spot)
{
  static int	i = 0;

  i++;
  if (is_in_tab(tmp[0], tab) == 1)
    {
      check_obj(tmp, i);
      new_obj(tmp, obj);
    }
  else if (my_strcompare("SPOT", tmp[0]))
    {
      check_spot(tmp, i);
      new_spot(tmp, spot);
    }
  else
    {
      fprintf(stderr, "Unknown object line %d\n", i);
      exit(EXIT_FAILURE);
    }
}
Пример #11
0
/*setup_windows{{{*/
void setup_windows(int flags) {
 obj_param_t tmp_parm;

 globl_drop_depth =25;
 globl_flags = DROP_SHADOW;
 init_gui(WIDTH, HEIGHT, flags);

 SET_COLOR(globl_fg, 		0   ,0   ,0);
 SET_COLOR(globl_bg, 		224 ,224 ,204);
 SET_COLOR(globl_move_color, 	0x1f,0x8f,0x1f);
 SET_COLOR(hscroll_color, 	0   ,0x7f,0xff);
 SET_COLOR(sprite_color, 	0xff,0x7f,0);
 SET_COLOR(window_color, 	0   ,0   ,0xff);
 SET_COLOR(scroll_b_color, 	0xff,0   ,0xff);
 SET_COLOR(scroll_a_color, 	0xff,0   ,0);

 change_message_grp = new_group(40,40, 202, 77, globl_flags, globl_drop_depth);
 simple_window(change_message_grp, 200, 75);
 PARM(50, 45,100,20, &globl_fg, &globl_bg, SHOW_FOCUS | QUIT_BUTTON, proc_button_box);
 tmp_parm.dp1 = (void *)"Okay";
 new_obj(change_message_grp, &tmp_parm);
 PARM(12,16,172,20,&globl_fg, &globl_bg, MAX_CHARS|SHOW_FOCUS, proc_edit_line);
 tmp_parm.d3 = 80;
 text_edit_object = new_obj(change_message_grp, &tmp_parm);

 select_grp = new_group(0,0,WIDTH, HEIGHT,0,0);
 PARM(305,126,320,240,&globl_fg,&globl_bg,0,select_special);
 select_special_object = new_obj(select_grp, &tmp_parm);


 PARM(0,0, 304, 126, 0,0, 0, select_quit_on_click);
 tmp_parm.user_flags = 0;
 new_obj(select_grp, &tmp_parm);

 PARM(0,126,304,240, 0,0, 0, select_quit_on_click);
 tmp_parm.user_flags = HORIZONTAL;
 new_obj(select_grp, &tmp_parm);

 PARM(0, 366, 305, 112, 0,0, 0, select_quit_on_click);
 tmp_parm.user_flags = 0;
 new_obj(select_grp, &tmp_parm);

 PARM(305, 0, 320, 126, 0,0, 0, select_quit_on_click);
 new_obj(select_grp, &tmp_parm);

 PARM(305, 366, 320, 114, 0,0, 0, select_quit_on_click);
 tmp_parm.user_flags = VERTICAL;
 new_obj(select_grp, &tmp_parm);

 PARM(625, 0, 15, 480, 0,0,0, select_quit_on_click);
 tmp_parm.user_flags = 0;
 new_obj(select_grp, &tmp_parm);

 main_grp = new_group(0,0, WIDTH, HEIGHT, 0, 0);

 PARM(0,0,WIDTH,HEIGHT,&globl_fg,&globl_bg,DROP_ACCUM|LOAD_XPM_FROM_ARRAY,proc_bitmap);
 tmp_parm.dp1 = back_xpm;
 background_object = new_obj(main_grp, &tmp_parm);

 PARM(82,22,0,0,&globl_fg,&globl_bg,
   TOGGLE|CALL_BUTTON|SHOW_FOCUS|LOAD_XPM_FROM_ARRAY,proc_icon_button);
 tmp_parm.callback = undo_button;
 tmp_parm.d1 = FALSE;
 tmp_parm.d2 = 1;
 tmp_parm.dp1 = undo_xpm;
 new_obj(main_grp, &tmp_parm);


 /* tools */

 PARM(124, 22, 0, 0, &globl_fg, &globl_bg,
   CALL_BUTTON|SHOW_FOCUS|LOAD_XPM_FROM_ARRAY, proc_icon_button);
 tmp_parm.callback = tool_change;
 tmp_parm.d1 = FALSE;
 tmp_parm.d2 = 2;
 tmp_parm.dp1 = select_xpm;
 select_object = new_obj(main_grp, &tmp_parm);

 PARM(82, 53, 0, 0, &globl_fg, &globl_bg,
   CALL_BUTTON|SHOW_FOCUS|LOAD_XPM_FROM_ARRAY, proc_icon_button);
 tmp_parm.callback = tool_change;
 tmp_parm.d1 = FALSE;
 tmp_parm.d2 = 2;
 tmp_parm.dp1 = pal_hi_low_xpm;
 pal_hi_low_object = new_obj(main_grp, &tmp_parm);

 PARM(124, 53, 0, 0, &globl_fg, &globl_bg, 
   CALL_BUTTON|SHOW_FOCUS|LOAD_XPM_FROM_ARRAY,proc_icon_button);
 tmp_parm.callback = tool_change;
 tmp_parm.d1 = FALSE;
 tmp_parm.d2 = 2;
 tmp_parm.dp1 = flip_xpm;
 flip_object = new_obj(main_grp, &tmp_parm);
 

 PARM(82,88,0,0,&globl_fg,&globl_bg,
   CALL_BUTTON|SHOW_FOCUS|LOAD_XPM_FROM_ARRAY,proc_icon_button);
 tmp_parm.callback = tool_change;
 tmp_parm.d1 = TRUE;
 tmp_parm.d2 = 2;
 tmp_parm.dp1 = line_xpm;
 line_object = new_obj(main_grp, &tmp_parm);
 last_tool = line_object;

 PARM(124,88,0,0,&globl_fg,&globl_bg,
   CALL_BUTTON|SHOW_FOCUS|LOAD_XPM_FROM_ARRAY,proc_icon_button);
 tmp_parm.callback = tool_change;
 tmp_parm.d1 = FALSE;
 tmp_parm.d2 = 2;
 tmp_parm.dp1 = put_pat_xpm;
 put_pat_object = new_obj(main_grp, &tmp_parm);

 PARM(82,123,0,0,&globl_fg,&globl_bg,
   CALL_BUTTON|SHOW_FOCUS|LOAD_XPM_FROM_ARRAY,proc_icon_button); 
 tmp_parm.callback = tool_change;
 tmp_parm.d1 = FALSE;
 tmp_parm.d2 = 2;
 tmp_parm.dp1 = fill_xpm;
 fill_object = new_obj(main_grp, &tmp_parm);

 PARM(124,123,0,0,&globl_fg,&globl_bg,
   CALL_BUTTON|SHOW_FOCUS|LOAD_XPM_FROM_ARRAY,proc_icon_button);
 tmp_parm.callback = tool_change;
 tmp_parm.d1 = FALSE;
 tmp_parm.d2 = 2;
 tmp_parm.dp1 = clear_to_color_xpm;
 clear_to_color_object = new_obj(main_grp, &tmp_parm);


 PARM(82,158,0,0,&globl_fg,&globl_bg,
   CALL_BUTTON|SHOW_FOCUS|LOAD_XPM_FROM_ARRAY,proc_icon_button); 
 tmp_parm.callback = tool_change;
 tmp_parm.d1 = FALSE;
 tmp_parm.d2 = 2;
 tmp_parm.dp1 = pic_xpm;
 pic_object = new_obj(main_grp, &tmp_parm);

 PARM(124,158,0,0,&globl_fg,&globl_bg,
   CALL_BUTTON|SHOW_FOCUS|LOAD_XPM_FROM_ARRAY,proc_icon_button); 
 tmp_parm.callback = tool_change;
 tmp_parm.d1 = FALSE;
 tmp_parm.d2 = 2;
 tmp_parm.dp1 = pic_pat_xpm;
 pic_pat_object = new_obj(main_grp, &tmp_parm);



 /* not tools */

#ifndef WINDOWS
 PARM(580,450,50,17,&globl_fg,&globl_bg,SHOW_FOCUS|CALL_BUTTON|DROP_SHADOW,proc_button_box);
 tmp_parm.dp1 = (void *)"F/W";
 tmp_parm.callback = fw_bottom;
 new_obj(main_grp, &tmp_parm);
#endif

 
 PARM(580,1,50,17,&globl_fg,&globl_bg,SHOW_FOCUS|CALL_BUTTON|DROP_SHADOW,proc_button_box);
 tmp_parm.dp1 = (void *)"Quit";
 tmp_parm.callback = really_quit;
 new_obj(main_grp, &tmp_parm);

 
 PARM(500,1,50,17,&globl_fg,&globl_bg,SHOW_FOCUS|CALL_BUTTON|DROP_SHADOW,proc_button_box);
 tmp_parm.dp1 = (void *)"About";
 tmp_parm.callback = about;
 new_obj(main_grp, &tmp_parm);

 PARM(20,1, 50,17,&globl_fg,&globl_bg,SHOW_FOCUS|CALL_BUTTON|DROP_SHADOW,proc_button_box);
 tmp_parm.dp1 = (void *)"Load";
 tmp_parm.user_flags = LOAD;
 tmp_parm.callback=load_save_top;
 new_obj(main_grp, &tmp_parm);

 load_grp = new_menu(20,5, load_menu, &globl_fg, &globl_bg);

 PARM(75,1, 50,17,&globl_fg,&globl_bg,SHOW_FOCUS|CALL_BUTTON|DROP_SHADOW,proc_button_box);
 tmp_parm.dp1 = (void *)"Save";
 tmp_parm.user_flags = SAVE;
 tmp_parm.callback=load_save_top;
 new_obj(main_grp, &tmp_parm);

 save_grp = new_menu(75,5, save_menu, &globl_fg, &globl_bg);
 high_low_grp = new_menu(124,88, high_low_menu, &globl_fg, &sprite_color);
 hor_ver_grp = new_menu(124,88,horizontal_vertical_menu, &globl_fg, &sprite_color);
 pal_hi_low_grp = new_menu(124,88, pal_hi_low_menu, &globl_fg, &sprite_color);
 copy_move_grp = new_menu(124,88,copy_move_menu, &globl_fg, &sprite_color);

 PARM(380,1,90,17,&globl_fg,&globl_bg,SHOW_FOCUS|CALL_BUTTON|DROP_SHADOW,proc_button_box);
 tmp_parm.dp1 = (void *)"Background";
 tmp_parm.callback = change_background;
 new_obj(main_grp, &tmp_parm);

 PARM(425,81,0,0,&globl_fg,&globl_bg,
   CALL_BUTTON|SHOW_FOCUS|LOAD_XPM_FROM_ARRAY,proc_icon_button);
 tmp_parm.callback = preview_zoom_change;
 tmp_parm.d1 = FALSE;
 tmp_parm	.d2 = 4;
 tmp_parm.dp1 = zoom_out_xpm;
 preview_zoom_out = new_obj(main_grp,&tmp_parm);

 PARM(461,81,0,0,&globl_fg,&globl_bg,
   CALL_BUTTON|SHOW_FOCUS|LOAD_XPM_FROM_ARRAY,proc_icon_button);
 tmp_parm.callback = preview_zoom_change;
 tmp_parm.d1 = FALSE;
 tmp_parm.d2 = 5;
 tmp_parm.dp1 = zoom_in_xpm;
 preview_zoom_in = new_obj(main_grp,&tmp_parm);

 PARM(499,83, 31,27, &globl_fg,&globl_bg,CALL_BUTTON,proc_button_box);
 tmp_parm.callback = change_bg_color;
 tmp_parm.dp1 = (char *)" ";
 bg_color_box = new_obj(main_grp, &tmp_parm);
 UPDATE_BG_COLOR;

 PARM(305,114,320,11,&globl_move_color, &globl_bg,SHOW_FOCUS|CALL_BUTTON,proc_scroll_bar);
 tmp_parm.d2 = 256;
 tmp_parm.d1 = 0;
 tmp_parm.callback = preview_scroll_change;
 preview_scroll_bar = new_obj(main_grp, &tmp_parm);

 PARM(292,126,11,240,&globl_move_color,&globl_bg,SHOW_FOCUS|CALL_BUTTON,proc_scroll_bar);
 tmp_parm.d2 = 0;
 tmp_parm.d1 = 0;
 preview_y_scroll = new_obj(main_grp,&tmp_parm);

 PARM(305,367,320,11,&globl_move_color,&globl_bg,SHOW_FOCUS|CALL_BUTTON,proc_scroll_bar);
 tmp_parm.d2 = 0;
 tmp_parm.d1 = 0;
 preview_x_scroll = new_obj(main_grp,&tmp_parm);


 tmp_parm.callback = preview_size_change;
 PARM(293,82,0,0,&globl_fg, &globl_bg, SHOW_FOCUS|CALL_BUTTON, proc_radio_button);
 tmp_parm.d1 = TRUE;
 tmp_parm.d2 = 1;
 tmp_parm.dp1 = (void *)"NTSC";
 preview_ntsc = new_obj(main_grp, &tmp_parm);

 PARM(293,96,0,0,&globl_fg, &globl_bg, SHOW_FOCUS|CALL_BUTTON, proc_radio_button);
 tmp_parm.d1 = FALSE;
 tmp_parm.d2 = 1;
 tmp_parm.dp1 = (void *)"PAL";
 preview_pal = new_obj(main_grp, &tmp_parm);

 PARM(348,82,0,0,&globl_fg, &globl_bg, SHOW_FOCUS|CALL_BUTTON, proc_radio_button);
 tmp_parm.d1 = TRUE;
 tmp_parm.d2 = 2;
 tmp_parm.dp1 = (void *)"40 cell";
 preview_40c = new_obj(main_grp, &tmp_parm);

 PARM(348,96,0,0,&globl_fg, &globl_bg, SHOW_FOCUS|CALL_BUTTON, proc_radio_button);
 tmp_parm.d1 = FALSE;
 tmp_parm.d2 = 2;
 tmp_parm.dp1 = (void *)"32 cell";
 preview_32c = new_obj(main_grp, &tmp_parm);




 PARM(190,297,11,176,&globl_move_color,&globl_bg,CALL_BUTTON|SHOW_FOCUS,proc_scroll_bar);
 tmp_parm.d2 = 0xf6;
 tmp_parm.d1 = 0;
 tmp_parm.callback = pattern_select_bot;
 pattern_select_scroll_bar = new_obj(main_grp, &tmp_parm);

 
 PARM(10,301,179,0xa*16,&globl_fg,&globl_bg,0,proc_pattern_select);
 pattern_select_object = new_obj(main_grp, &tmp_parm);

 PARM(10,22,70,260,&globl_fg,&globl_bg,0,proc_palette_change_object);
 palette_change_object = new_obj(main_grp, &tmp_parm);

 /* Pattern edit */
 PARM(88,200,67,83,&globl_fg,&globl_bg,0,proc_pattern_edit);
 pattern_edit_object = new_obj(main_grp, &tmp_parm);

 PARM(305,126,320,240,&globl_fg,&globl_bg,0,proc_preview_object);
 preview_object = new_obj(main_grp,&tmp_parm);

 PARM(540,88,65,17,&globl_fg,&globl_bg,SHOW_FOCUS|CALL_BUTTON,proc_button_box);
 tmp_parm.dp1 = (void *)"overlay";
 tmp_parm.callback = load_ovr_window;
 preview_overlay = new_obj(main_grp, &tmp_parm);


/* View and edit what? */

 tmp_parm.callback = edit_change;
 PARM(254,96,0,0,&globl_fg,&globl_bg, 
   SHOW_FOCUS|CALL_BUTTON|LOAD_XPM_FROM_ARRAY, proc_icon_button);
 tmp_parm.d1 = TRUE;
 tmp_parm.d2 = 3;
 tmp_parm.user_flags = EDIT_SCROLL_A;
 tmp_parm.dp1 = scroll_a_edit_xpm;
 new_obj(main_grp, &tmp_parm);
 currently_editing = EDIT_SCROLL_A;

 PARM(254,120,0,0,&globl_fg,&globl_bg, 
   SHOW_FOCUS|CALL_BUTTON|LOAD_XPM_FROM_ARRAY, proc_icon_button);
 tmp_parm.d1 = FALSE;
 tmp_parm.d2 = 3;
 tmp_parm.user_flags = EDIT_SCROLL_B;
 tmp_parm.dp1 = scroll_b_edit_xpm;
 new_obj(main_grp, &tmp_parm);

 PARM(254,144,0,0,&globl_fg,&globl_bg, 
   SHOW_FOCUS|CALL_BUTTON|LOAD_XPM_FROM_ARRAY, proc_icon_button);
 tmp_parm.d1 = FALSE;
 tmp_parm.d2 = 3;
 tmp_parm.user_flags = EDIT_SPRITE;
 tmp_parm.dp1 = sprite_edit_xpm;
 new_obj(main_grp, &tmp_parm);


 tmp_parm.callback = edit_change;
 PARM(230,96,0,0,&globl_fg,&globl_bg, 
   SHOW_FOCUS|CALL_BUTTON|LOAD_XPM_FROM_ARRAY|SINGLE_RADIO, proc_icon_button);
 tmp_parm.d1 = TRUE;
 tmp_parm.d2 = 4;
 tmp_parm.user_flags = VIEW_SCROLL_B;
 tmp_parm.dp1 = scroll_b_xpm;
 new_obj(main_grp, &tmp_parm);

 PARM(230,120,0,0,&globl_fg,&globl_bg, 
   SHOW_FOCUS|CALL_BUTTON|LOAD_XPM_FROM_ARRAY|SINGLE_RADIO, proc_icon_button);
 tmp_parm.d1 = TRUE;
 tmp_parm.d2 = 4;
 tmp_parm.user_flags = VIEW_SCROLL_A;
 tmp_parm.dp1 = scroll_a_xpm;
 new_obj(main_grp, &tmp_parm);


 PARM(230,120+24,0,0,&globl_fg,&globl_bg, 
   SHOW_FOCUS|CALL_BUTTON|LOAD_XPM_FROM_ARRAY|SINGLE_RADIO, proc_icon_button);
 tmp_parm.d1 = TRUE;
 tmp_parm.d2 = 4;
 tmp_parm.user_flags = VIEW_SCROLL_B_HIGH;
 tmp_parm.dp1 = scroll_b_high_xpm;
 new_obj(main_grp, &tmp_parm);

 PARM(230,120+24+24,0,0,&globl_fg,&globl_bg, 
   SHOW_FOCUS|CALL_BUTTON|LOAD_XPM_FROM_ARRAY|SINGLE_RADIO, proc_icon_button);
 tmp_parm.d1 = TRUE;
 tmp_parm.d2 = 4;
 tmp_parm.user_flags = VIEW_SCROLL_A_HIGH;
 tmp_parm.dp1 = scroll_a_high_xpm;
 new_obj(main_grp, &tmp_parm);





 PARM(353,25,31,31, &hscroll_color, &globl_bg, 0, proc_scroll_size);
 new_obj(main_grp, &tmp_parm); 

 PARM(415,25,41,41, &globl_fg, &globl_bg, 0, proc_sprite_size);
 new_obj(main_grp, &tmp_parm); 

 PARM(369, 64,0,0,&globl_fg, &globl_bg, 0, proc_ctext);
 tmp_parm.dp1 = (void *)malloc( 8 );
 snprintf(tmp_parm.dp1, 8, "64x64");
 scroll_width = 1;
 scroll_height = 1;

 scroll_size2 =new_obj(main_grp, &tmp_parm);

 sprite_width = 0;
 sprite_height = 0;

 PARM(410, 393,41,51, &globl_fg, &globl_bg, CALL_BUTTON|MODULAR|HEX|INACTIVE, proc_knob);
 tmp_parm.d1 = 40;
 tmp_parm.d2 = 0x400;
 tmp_parm.user_flags = KNOB;
 tmp_parm.callback = knob_tick;
 knob = new_obj(main_grp, &tmp_parm);


 PARM(244,410, 23,24,&globl_fg, &globl_bg,
   LOAD_XPM_FROM_ARRAY|SHOW_FOCUS|CALL_BUTTON|SINGLE_RADIO,proc_icon_button);
 tmp_parm.dp1 = small_knob_xpm;
 tmp_parm.d1 = FALSE;
 tmp_parm.d2 = 200;
 tmp_parm.callback = knob_select;
 knob_icon = new_obj(main_grp,&tmp_parm);

 PARM(315, 422, 0,0, &globl_fg, &globl_bg, 0, proc_ctext);
 tmp_parm.dp1 = (void *)malloc(64);
 snprintf( tmp_parm.dp1, 64, ":<");
 knob_text = new_obj(main_grp,&tmp_parm);


 PARM(272, 256, 11, 82, &globl_fg, &globl_bg, 0, proc_scroll_bar_special)
 tmp_parm.d1 = 2;
 tmp_parm.d2 = 2;
 tmp_parm.user_flags = HORIZONTAL;
 horizontal_scroll_bar = new_obj(main_grp, &tmp_parm);

 PARM(493,385, 82,11, &globl_fg, &globl_bg, 0, proc_scroll_bar_special);
 tmp_parm.d1 = 0;
 tmp_parm.d2 = 1;
 tmp_parm.user_flags = VERTICAL;
 vertical_scroll_bar = new_obj(main_grp, &tmp_parm);

 PARM(462, 401, 0,0, &globl_fg, &globl_bg, SHOW_FOCUS|CALL_BUTTON|LOAD_XPM_FROM_ARRAY,
   proc_icon_button);
 tmp_parm.d1 = TRUE;
 tmp_parm.d2 = 5;
 tmp_parm.dp1 = (void *)scroll_a_edit_xpm;
 tmp_parm.callback = knob_tick;
 tmp_parm.user_flags = SELECT_A;
 select_a_object = new_obj(main_grp, &tmp_parm);

 PARM(462, 423, 0,0, &globl_fg, &globl_bg, SHOW_FOCUS|CALL_BUTTON|LOAD_XPM_FROM_ARRAY,
   proc_icon_button);
 tmp_parm.d1 = FALSE;
 tmp_parm.d2 = 5;
 tmp_parm.dp1 = (void *)scroll_b_edit_xpm;
 tmp_parm.callback = knob_tick;
 tmp_parm.user_flags = SELECT_B;
 new_obj(main_grp, &tmp_parm);

 tmp_parm.proc = load_default_mega;
 select_b_object = new_obj(main_grp, &tmp_parm);

 PARM(172, 177, 0,0, &globl_fg, &globl_bg, SHOW_FOCUS|SINGLE_RADIO|LOAD_XPM_FROM_ARRAY,
   proc_icon_button);
// tmp_parm.callback = stop_bot;
 tmp_parm.dp1 = (void *)clob_xpm;
 tmp_parm.d1 = FALSE;
 tmp_parm.d2 = 401;
 clob_object = new_obj(main_grp, &tmp_parm);

 PARM(172, 202, 0,0, &globl_fg, &globl_bg, CALL_BUTTON|SHOW_FOCUS|SINGLE_RADIO|LOAD_XPM_FROM_ARRAY,
   proc_icon_button);
 tmp_parm.callback = stop_bot;
 tmp_parm.dp1 = (void *)stop_xpm;
 tmp_parm.d1 = FALSE;
 tmp_parm.d2 = 401;
 stop_object = new_obj(main_grp, &tmp_parm);

 PARM(172, 227, 0,0, &globl_fg, &globl_bg, CALL_BUTTON|SHOW_FOCUS|SINGLE_RADIO|LOAD_XPM_FROM_ARRAY,
   proc_icon_button);
 tmp_parm.callback = go_bot;
 tmp_parm.dp1 = (void *)clear_xpm;
 tmp_parm.d1 = FALSE;
 tmp_parm.d2 = 401;
 new_obj(main_grp, &tmp_parm);

 PARM(172, 252, 0,0, &globl_fg, &globl_bg, CALL_BUTTON|SHOW_FOCUS|SINGLE_RADIO|LOAD_XPM_FROM_ARRAY,
   proc_icon_button);
 tmp_parm.callback = new_bot;
 tmp_parm.dp1 = (void *)new_xpm;
 tmp_parm.d1 = FALSE;
 tmp_parm.d2 = 401;
 new_obj(main_grp, &tmp_parm);

 PARM(490, 400, 140, 45, &globl_fg, &globl_bg, DROP_SHADOW, proc_info);
 info_object = new_obj(main_grp, &tmp_parm);

/* SHADOW BOX */

 PARM(170, 175, 25, 100, &globl_fg, &globl_bg, DROP_SHADOW, proc_shadow_box);
 new_obj(main_grp, &tmp_parm);

 PARM(460, 400, 25, 45, &globl_fg, &globl_bg, DROP_SHADOW, proc_shadow_box);
 new_obj(main_grp, &tmp_parm);


 PARM(270, 254, 14, 86, &globl_fg, &globl_bg, DROP_SHADOW, proc_shadow_box);
 new_obj(main_grp, &tmp_parm);

 PARM(491,383, 86, 14, &globl_fg, &globl_bg, DROP_SHADOW, proc_shadow_box);
 new_obj(main_grp, &tmp_parm);

 PARM(240, 407, 150, 30, &globl_fg, &globl_bg, DROP_SHADOW, proc_shadow_box);
 knob_message_box = new_obj(main_grp, &tmp_parm);

 PARM(405, 400, 50, 45, &globl_fg, &globl_bg, DROP_SHADOW, proc_shadow_box);
 new_obj(main_grp, &tmp_parm);

 PARM(340, 21, 58, 50, &globl_fg,&globl_bg, DROP_SHADOW, proc_shadow_box);
 scroll_size1 = new_obj(main_grp, &tmp_parm);

 PARM(340+67, 21, 58, 50, &globl_fg,&globl_bg, DROP_SHADOW, proc_shadow_box);
 sprite_size1 = new_obj(main_grp, &tmp_parm);


 PARM(340+67+67+((58/4)-6), 20+((50/4)-6)-1, 20, 20, &globl_fg, &globl_bg, 
   CALL_BUTTON|SHOW_FOCUS|SINGLE_RADIO|LOAD_XPM_FROM_ARRAY,proc_icon_button);
 tmp_parm.callback = sprite_overlay;
 tmp_parm.dp1 = (void *)minus_xpm;
 tmp_parm.d1 = FALSE;
 tmp_parm.d2 = 401;
 minus_object = new_obj(main_grp, &tmp_parm);

 PARM(340+67+67+((58/4)-6), 20+((50/2)+2)-1, 20, 20, &globl_fg, &globl_bg, 
   CALL_BUTTON|SHOW_FOCUS|SINGLE_RADIO|LOAD_XPM_FROM_ARRAY,proc_icon_button);
 tmp_parm.dp1 = (void *)plus_xpm;
 tmp_parm.d1 = FALSE;
 tmp_parm.d2 = 401;
 plus_object =  new_obj(main_grp, &tmp_parm);


 PARM(340+67+67+((58/4)+15), 20+((50/4)-6)-1, 20, 20, &globl_fg, &globl_bg, 
   CALL_BUTTON|SHOW_FOCUS|SINGLE_RADIO|LOAD_XPM_FROM_ARRAY,proc_icon_button);
 tmp_parm.dp1 = (void *)a_xpm;
 tmp_parm.d1 = FALSE;
 tmp_parm.d2 = 401;
 a_object = new_obj(main_grp, &tmp_parm);

 PARM(340+67+67+((58/4)+15), 20+((50/2)+2)-1, 20, 20, &globl_fg, &globl_bg, 
   CALL_BUTTON|SHOW_FOCUS|SINGLE_RADIO|LOAD_XPM_FROM_ARRAY,proc_icon_button);
 tmp_parm.dp1 = (void *)b_xpm;
 tmp_parm.d1 = FALSE;
 tmp_parm.d2 = 401;
 b_object = new_obj(main_grp, &tmp_parm);





 PARM(340+67+67,21,58,50, &globl_fg, &globl_bg, DROP_SHADOW, proc_shadow_box);
 new_obj(main_grp,&tmp_parm);
 
 
 PARM(228, 94, 50, 148-24-24, &globl_fg,&globl_bg, DROP_SHADOW, proc_shadow_box);
 new_obj(main_grp, &tmp_parm);

 PARM(8,19,152,266,&globl_fg,&globl_bg,DROP_SHADOW,proc_shadow_box);
 new_obj(main_grp, &tmp_parm);

 PARM(8,295,198,179,&globl_fg,&globl_bg,DROP_SHADOW,proc_shadow_box);
 new_obj(main_grp, &tmp_parm);

 

 PARM(288,80,340,300,&globl_fg,&globl_bg,DROP_SHADOW,proc_shadow_box);
 preview_box_object =  new_obj(main_grp, &tmp_parm);

 red.r = 0x7f;
 red.g = 0;
 red.b = 0;

 green.r = 0;
 green.g = 0x7f;
 green.b = 0;
  
 blue.r = 0;
 blue.g = 0;
 blue.b = 0x7f;

 PARM(168,22,100,11,&red,&globl_bg,SHOW_FOCUS|CALL_BUTTON,proc_scroll_bar);
 tmp_parm.d2 = 7;
 tmp_parm.d1 = 
  current_vdp->palette[current_palette][current_palette_index].r / (0xff/7);
 tmp_parm.callback = color_change_bot;
 rgb_red_object = new_obj(main_grp, &tmp_parm);

 tmp_parm.d1 = 
  current_vdp->palette[current_palette][current_palette_index].g / (0xff/7);
 tmp_parm.y+=18;
 tmp_parm.fg = &green;
 rgb_green_object = new_obj(main_grp, &tmp_parm);


 tmp_parm.d1 = 
  current_vdp->palette[current_palette][current_palette_index].b / (0xff/7);
 tmp_parm.y+=18;
 tmp_parm.fg = &blue;
 rgb_blue_object = new_obj(main_grp, &tmp_parm);

 PARM(301,38,24,8,&current_color_text_color,&globl_bg,0,proc_ctext);
 tmp_parm.dp1 = (void *)malloc(4);
 current_color_text_object = new_obj(main_grp,&tmp_parm);

 PARM(301,52,24,8, &current_color_text_color, &globl_bg, 0,proc_ctext);
 tmp_parm.dp1 = (void *)malloc(4);
 current_color_text2_object = new_obj(main_grp, &tmp_parm);
  
 update_color_text();

 PARM(276,30,50,30,&globl_fg,&current_vdp->palette[0][0],0,proc_shadow_box);
 current_color_object = new_obj(main_grp, &tmp_parm);

 PARM(165,19,170,55,&globl_fg,&globl_bg,DROP_SHADOW,proc_shadow_box);
 rgb_box_object = new_obj(main_grp, &tmp_parm);



 overlay_sel = setup_overlay_window(400,300, LOAD, "an image", load_ovr_callback);
 background_sel = setup_overlay_window(400,300, LOAD, "an image", load_background_callback);


 pointers = new_group(200, 300, 151,151,globl_flags,globl_drop_depth);
 simple_window(pointers, 150, 150);

 PARM( 25, 100, 100, 30, &globl_fg, &globl_bg, QUIT_BUTTON|SHOW_FOCUS, proc_button_box);
 tmp_parm.dp1 = (char *)"OK";
 new_obj(pointers, &tmp_parm);

 PARM(30, 20, 0,0, &hscroll_color, &globl_bg, SHOW_FOCUS|SINGLE_RADIO, proc_radio_button);
 tmp_parm.d1 = FALSE;
 tmp_parm.d2 = 50;
 tmp_parm.dp1 = (char *)"hscroll";
 hscroll_radio = new_obj(pointers, &tmp_parm);

 PARM(30, 31, 0,0, &sprite_color, &globl_bg, SHOW_FOCUS|SINGLE_RADIO, proc_radio_button);
 tmp_parm.d1 = FALSE;
 tmp_parm.d2 = 50;
 tmp_parm.dp1 = (char *)"sprite";
 sprite_radio = new_obj(pointers, &tmp_parm);

 PARM(30, 42, 0,0, &scroll_a_color, &globl_bg, SHOW_FOCUS|SINGLE_RADIO, proc_radio_button);
 tmp_parm.d1 = FALSE;
 tmp_parm.d2 = 50;
 tmp_parm.dp1 = (char *)"scroll_a";
 scroll_a_radio = new_obj(pointers, &tmp_parm);

 PARM(30, 53, 0,0, &scroll_b_color, &globl_bg, SHOW_FOCUS|SINGLE_RADIO, proc_radio_button);
 tmp_parm.d1 = FALSE;
 tmp_parm.d2 = 50;
 tmp_parm.dp1 = (char *)"scroll_b";
 scroll_b_radio = new_obj(pointers, &tmp_parm);

 PARM(30, 64, 0,0, &window_color, &globl_bg, SHOW_FOCUS|SINGLE_RADIO, proc_radio_button);
 tmp_parm.d1 = FALSE;
 tmp_parm.d2 = 50;
 tmp_parm.dp1 = (char *)"window";
 window_radio = new_obj(pointers, &tmp_parm);

 load_sel = setup_overlay_window(400,300, LOAD, "123456", load_save_bottom);
 save_sel = setup_overlay_window(400,300, SAVE, "123456", load_save_bottom);
}
Пример #12
0
 static TagIncludedValue from_float(double f) {
     TagIncludedValue ret;
     ret.u.obj = new_obj(&CFloat, TYPE_FLOAT);
     ret.u.obj->u.fv = f;
     return ret;
 }