Example #1
0
void
Window_init( Handle self, HV * profile)
{
   dPROFILE;
   SV * sv;
   inherited init( self, profile);

   opt_set( optSystemSelectable);
   opt_assign( optOwnerIcon, pget_B( ownerIcon));
   opt_assign( optMainWindow, pget_B( mainWindow));
   my-> set_icon( self, pget_H( icon));
   my-> menuColorIndex( self, true, ciFore,          pget_i( menuColor)            );
   my-> menuColorIndex( self, true, ciBack,          pget_i( menuBackColor)        );
   my-> menuColorIndex( self, true, ciHiliteText,    pget_i( menuHiliteColor)      );
   my-> menuColorIndex( self, true, ciHilite,        pget_i( menuHiliteBackColor)  );
   my-> menuColorIndex( self, true, ciDisabledText,  pget_i( menuDisabledColor)    );
   my-> menuColorIndex( self, true, ciDisabled,      pget_i( menuDisabledBackColor));
   my-> menuColorIndex( self, true, ciLight3DColor,  pget_i( menuLight3DColor)     );
   my-> menuColorIndex( self, true, ciDark3DColor,   pget_i( menuDark3DColor)      );
   SvHV_Font( pget_sv( menuFont), &Font_buffer, "Window::init");
   my-> set_menu_font  ( self, Font_buffer);
   if ( SvTYPE( sv = pget_sv( menuItems)) != SVt_NULL)
      my-> set_menuItems( self, sv);
   my-> set_modalResult( self, pget_i( modalResult));
   my-> set_modalHorizon( self, pget_B( modalHorizon));
   CORE_INIT_TRANSIENT(Window);
}
Example #2
0
void
Timer_init( Handle self, HV * profile)
{
   inherited init( self, profile);
   my-> update_sys_handle( self, profile);
   CORE_INIT_TRANSIENT(Timer);
}
Example #3
0
void
AccelTable_init( Handle self, HV * profile)
{
	dPROFILE;
	inherited init( self, profile);
	var-> system = false;
	my-> set_items( self, pget_sv( items));
	CORE_INIT_TRANSIENT(AccelTable);
}
Example #4
0
void
AbstractMenu_init( Handle self, HV * profile)
{
	dPROFILE;
	inherited init( self, profile);
	var-> anchored = kind_of( self, CMenu);
	my-> update_sys_handle( self, profile);
	my-> set_items( self, pget_sv( items));
	if ( var-> system) apc_menu_update( self, nil, var-> tree);
	if ( pget_B( selected)) my-> set_selected( self, true);
	CORE_INIT_TRANSIENT(AbstractMenu);
}
Example #5
0
void
Printer_init( Handle self, HV * profile)
{
	dPROFILE;
	char * prn;
	inherited init( self, profile);
	if ( !apc_prn_create( self))
		croak("Cannot create printer");
	prn = pget_c( printer);
	if ( strlen( prn) == 0) prn = my-> get_default_printer( self);
	my-> set_printer( self, prn);
	CORE_INIT_TRANSIENT(Printer);
}
Example #6
0
void
DeviceBitmap_init( Handle self, HV * profile)
{
   dPROFILE;
   inherited init( self, profile);
   var-> w = pget_i( width);
   var-> h = pget_i( height);
   var-> monochrome = pget_B( monochrome);
   if ( !apc_dbm_create( self, var-> monochrome))
      croak("RTC0110: Cannot create device bitmap");
   inherited begin_paint( self);
   opt_set( optInDraw);
   CORE_INIT_TRANSIENT(DeviceBitmap);
}
Example #7
0
void
Clipboard_init( Handle self, HV * profile)
{
	inherited init( self, profile);
	if ( !apc_clipboard_create(self))
		croak( "Cannot create clipboard");
	if (clipboards == 0) {
		Clipboard_register_format_proc( self, "Text",  (void*)text_server);
		Clipboard_register_format_proc( self, "Image", (void*)image_server);
		Clipboard_register_format_proc( self, "UTF8",  (void*)utf8_server);
		protect_formats = 1;
	}
	clipboards++;
	CORE_INIT_TRANSIENT(Clipboard);
}
Example #8
0
void
Drawable_init( Handle self, HV * profile)
{
   dPROFILE;
   inherited init( self, profile);
   apc_gp_init( self);
   var-> w = var-> h = 0;
   my-> set_color        ( self, pget_i ( color));
   my-> set_backColor    ( self, pget_i ( backColor));
   my-> set_fillWinding  ( self, pget_B ( fillWinding));
   my-> set_fillPattern  ( self, pget_sv( fillPattern));
   my-> set_lineEnd      ( self, pget_i ( lineEnd));
   my-> set_lineJoin     ( self, pget_i ( lineJoin));
   my-> set_linePattern  ( self, pget_sv( linePattern));
   my-> set_lineWidth    ( self, pget_i ( lineWidth));
   my-> set_region       ( self, pget_H ( region));
   my-> set_rop          ( self, pget_i ( rop));
   my-> set_rop2         ( self, pget_i ( rop2));
   my-> set_textOpaque   ( self, pget_B ( textOpaque));
   my-> set_textOutBaseline( self, pget_B ( textOutBaseline));
   my-> set_splinePrecision( self, pget_i ( splinePrecision));
   if ( pexist( translate))
   {
      AV * av = ( AV *) SvRV( pget_sv( translate));
      Point tr = {0,0};
      SV ** holder = av_fetch( av, 0, 0);
      if ( holder) tr.x = SvIV( *holder); else warn("RTC0059: Array panic on 'translate'");
      holder = av_fetch( av, 1, 0);
      if ( holder) tr.y = SvIV( *holder); else warn("RTC0059: Array panic on 'translate'");
      my-> set_translate( self, tr);
   }
   SvHV_Font( pget_sv( font), &Font_buffer, "Drawable::init");
   my-> set_font( self, Font_buffer);
   my-> set_palette( self, pget_sv( palette));
   CORE_INIT_TRANSIENT(Drawable);
}
Example #9
0
void
Application_init( Handle self, HV * profile)
{
   dPROFILE;
   int hintPause = pget_i( hintPause);
   Color hintColor = pget_i( hintColor), hintBackColor = pget_i( hintBackColor);
   SV * hintFont = pget_sv( hintFont);
   SV * sv;
   char * hintClass      = pget_c( hintClass);
   if ( application != nilHandle) 
      croak( "Attempt to create more than one application instance");

   CDrawable-> init( self, profile);
   list_create( &var->  widgets, 16, 16);
   list_create( &var->  modalHorizons, 0, 8);
   application = self;
   if ( !apc_application_create( self))
      croak( "Error creating application");
/* Widget init */
   SvHV_Font( pget_sv( font), &Font_buffer, "Application::init");
   my-> set_font( self, Font_buffer);
   SvHV_Font( pget_sv( popupFont), &Font_buffer, "Application::init");
   my-> set_popup_font( self, Font_buffer);
   {
      AV * av = ( AV *) SvRV( pget_sv( designScale));
      SV ** holder = av_fetch( av, 0, 0);
      if ( holder)
         var->  designScale. x = SvNV( *holder);
      else
         warn("Array panic on 'designScale'");
      holder = av_fetch( av, 1, 0);
      if ( holder)
         var->  designScale. y = SvNV( *holder);
      else
         warn("Array panic on 'designScale'");
      pdelete( designScale);
   }
   var->  text = duplicate_string("");
   opt_set( optModalHorizon);

   /* store extra info */
   {
      HV * hv = ( HV *) SvRV( var-> mate);
      (void) hv_store( hv, "PrinterClass",  12, newSVpv( pget_c( printerClass),  0), 0);
      (void) hv_store( hv, "PrinterModule", 13, newSVpv( pget_c( printerModule), 0), 0);
      (void) hv_store( hv, "HelpClass",     9,  newSVpv( pget_c( helpClass),     0), 0);
      (void) hv_store( hv, "HelpModule",    10, newSVpv( pget_c( helpModule),    0), 0);
   }

   {
      HV * profile = newHV();
      static Timer_vmt HintTimerVmt;

      pset_H( owner, self);
      pset_i( timeout, hintPause);
      pset_c( name, "HintTimer");
      var->  hintTimer = create_instance( "Prima::Timer");
      protect_object( var-> hintTimer);
      hv_clear( profile);
      memcpy( &HintTimerVmt, CTimer, sizeof( HintTimerVmt));
      HintTimerVmt. handle_event = Application_HintTimer_handle_event;
      (( PTimer) var->  hintTimer)-> self = &HintTimerVmt;

      pset_H( owner, self);
      pset_i( color, hintColor);
      pset_i( backColor, hintBackColor);
      pset_i( visible, 0);
      pset_i( selectable, 0);
      pset_i( showHint, 0);
      pset_c( name, "HintWidget");
      pset_sv( font, hintFont);
      var->  hintWidget = create_instance( hintClass);
      protect_object( var->  hintWidget);
      sv_free(( SV *) profile);
   }

   if ( SvTYPE( sv = pget_sv( accelItems)) != SVt_NULL)
      my-> set_accelItems( self, sv);
   if ( SvTYPE( sv = pget_sv( popupItems)) != SVt_NULL)
      my-> set_popupItems( self, sv);
   pdelete( accelTable);
   pdelete( accelItems);
   pdelete( popupItems);

   my-> set( self, profile);
   CORE_INIT_TRANSIENT(Application);
}