示例#1
0
SV *
Application_get_system_info( char * dummy)
{
   HV * profile = newHV();
   char system   [ 1024];
   char release  [ 1024];
   char vendor   [ 1024];
   char arch     [ 1024];
   char gui_desc [ 1024];
   int  os, gui;

   os  = apc_application_get_os_info( system, sizeof( system),
                                      release, sizeof( release),
                                      vendor, sizeof( vendor),
                                      arch, sizeof( arch));
   gui = apc_application_get_gui_info( gui_desc, sizeof( gui_desc));

   pset_i( apc,            os);
   pset_i( gui,            gui);
   pset_c( system,         system);
   pset_c( release,        release);
   pset_c( vendor,         vendor);
   pset_c( architecture,   arch);
   pset_c( guiDescription, gui_desc);

   return newRV_noinc(( SV *) profile);
}
示例#2
0
static void * 
open_load( PImgCodec instance, PImgLoadFileInstance fi)
{
	LoadRec * l = malloc( sizeof( LoadRec));
	HV * profile = fi-> fileProperties;
	
	if ( !l) return nil;
	memset( l, 0, sizeof( LoadRec));
	
	GIF_CALL 0;
	if ( !( l-> gft = DGifOpen( fi-> req, my_gif_read GIF_ERROR_ARG))) {
		free( l);
		return nil;
	}
	fi-> stop = true;

	l-> passed  = -1;
	l-> transparent = -1;

	if ( fi-> loadExtras) {
		pset_i( screenWidth,           l-> gft-> SWidth);
		pset_i( screenHeight,          l-> gft-> SHeight);
		pset_i( screenColorResolution, l-> gft-> SColorResolution);
		pset_i( screenBackGroundColor, l-> gft-> SBackGroundColor);
		pset_sv_noinc( screenPalette,  make_palette_sv( l-> gft-> SColorMap));
	}
	return l;
}
示例#3
0
文件: Window.c 项目: Absolight/Prima
Bool
Window_taskListed( Handle self, Bool set, Bool taskListed)
{
   HV * profile;
   if ( !set)
      return apc_window_get_task_listed( self);
   profile = newHV();
   pset_i( taskListed, taskListed);
   my-> set( self, profile);
   sv_free(( SV *) profile);
   return nilHandle;
}
示例#4
0
文件: Window.c 项目: Absolight/Prima
int
Window_borderStyle( Handle self, Bool set, int borderStyle)
{
   HV * profile;
   if ( !set)
      return apc_window_get_border_style( self);
   profile = newHV();
   pset_i( borderStyle, borderStyle);
   my-> set( self, profile);
   sv_free(( SV *) profile);
   return nilHandle;
}
示例#5
0
文件: Window.c 项目: Absolight/Prima
Bool
Window_onTop( Handle self, Bool set, Bool onTop)
{
   HV * profile;
   if ( !set)
      return apc_window_get_on_top( self);
   profile = newHV();
   pset_i( onTop, onTop);
   my-> set( self, profile);
   sv_free(( SV *) profile);
   return true;
}
示例#6
0
static Handle xdup( Handle self, char * className)
{
   Handle h;
   PDrawable i;
   HV * profile = newHV();
   Point s;

   pset_H( owner,        var-> owner);
   pset_i( width,        var-> w);
   pset_i( height,       var-> h);
   pset_i( type,         var-> monochrome ? imMono : imRGB);

   h = Object_create( className, profile);
   sv_free(( SV *) profile);
   i = ( PDrawable) h;
   s = i-> self-> get_size( h);
   i-> self-> begin_paint( h);
   i-> self-> put_image_indirect( h, self, 0, 0, 0, 0, s.x, s.y, s.x, s.y, ropCopyPut);
   i-> self-> end_paint( h);
   --SvREFCNT( SvRV( i-> mate));
   return h;
}
示例#7
0
文件: Window.c 项目: Absolight/Prima
SV *
Window_menuItems( Handle self, Bool set, SV * menuItems)
{
   dPROFILE;
   if ( var-> stage > csFrozen) return nilSV;

   if ( !set)
      return var-> menu ? CMenu( var-> menu)-> get_items( var-> menu, "") : nilSV;

   if ( var-> menu == nilHandle) {
     if ( SvTYPE( menuItems)) {
         HV * profile = newHV();
         pset_sv( items, menuItems);
         pset_H ( owner, self);
         pset_i ( selected, false);
         my-> set_menu( self, create_instance( "Prima::Menu"));
         sv_free(( SV *) profile);
      }
   } else
     CMenu( var-> menu)-> set_items( var-> menu, menuItems);
   return menuItems;
}
示例#8
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);
}