static void unicapgtk_video_display_compute_child_allocation( GtkFrame  *frame, GtkAllocation *child_allocation )
{
   UnicapgtkVideoDisplay *ugtk = UNICAPGTK_VIDEO_DISPLAY( frame );
   
   GTK_FRAME_CLASS( parent_class )->compute_child_allocation( frame, child_allocation );
   
   if( child_allocation->width < 0 )
   {
      child_allocation->width = ugtk->crop_width;
   }
   if( child_allocation->height < 0 )
   {
      child_allocation->height = ugtk->crop_height;
   }
   
   if( ugtk->scale_to_fit )
   {
      return;
   }

   if( child_allocation->width > ugtk->crop_width )
   {
      child_allocation->x += GTK_ASPECT_FRAME( frame )->xalign *
	 (child_allocation->width - ugtk->crop_width);
      child_allocation->width = ugtk->crop_width;
   }
   if( child_allocation->height > ugtk->crop_height )
   {
      child_allocation->y += GTK_ASPECT_FRAME( frame )->yalign *
	 (child_allocation->height - ugtk->crop_height);
      child_allocation->height = ugtk->crop_height;
   }
}
Exemplo n.º 2
0
void phoneBookEntry_class_init(PhoneBookEntryClass *klass) {
    GObjectClass *object_class = G_OBJECT_CLASS(klass);
    GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
    GtkFrameClass *frame_class = GTK_FRAME_CLASS(klass);

    g_type_class_add_private(object_class, sizeof(phoneBookEntryPrivate));
}
static void unicapgtk_video_display_class_init( UnicapgtkVideoDisplayClass *klass )
{
   GObjectClass *object_class = G_OBJECT_CLASS( klass );
   GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS( klass );
   GtkFrameClass *frame_class = GTK_FRAME_CLASS( klass );

   parent_class = g_type_class_peek_parent( klass );

   object_class->set_property = unicapgtk_video_display_set_property;
   object_class->get_property = unicapgtk_video_display_get_property;

   gtk_object_class->destroy  = unicapgtk_video_display_destroy;

   frame_class->compute_child_allocation = unicapgtk_video_display_compute_child_allocation;

   /**
    * UnicapgtkVideoDisplay::unicapgtk_video_display_predisplay:
    * 
    */
   unicapgtk_video_display_signals[UNICAPGTK_VIDEO_DISPLAY_PREDISPLAY_SIGNAL] = 
      g_signal_new( "unicapgtk_video_display_predisplay",
		    G_TYPE_FROM_CLASS(klass),
		    G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
		    G_STRUCT_OFFSET(UnicapgtkVideoDisplayClass, unicapgtk_video_display),
		    NULL, 
		    NULL,                
		    g_cclosure_marshal_VOID__POINTER,
		    G_TYPE_NONE, 1, 
		    G_TYPE_POINTER );

/*    unicapgtk_video_display_signals[UNICAPGTK_VIDEO_DISPLAY_POSTDISPLAY_SIGNAL] =  */
/*       g_signal_new( "unicapgtk_video_display_postdisplay", */
/* 		    G_TYPE_FROM_CLASS(klass), */
/* 		    G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION, */
/* 		    G_STRUCT_OFFSET(UnicapgtkVideoDisplayClass, unicapgtk_video_display), */
/* 		    NULL,  */
/* 		    NULL,                 */
/* 		    g_cclosure_marshal_VOID__POINTER, */
/* 		    G_TYPE_NONE, 1, */
/* 		    G_TYPE_POINTER ); */

/*    unicapgtk_video_display_signals[UNICAPGTK_VIDEO_DISPLAY_DISPLAY_PIXBUF_SIGNAL] =  */
/*       g_signal_new( "unicapgtk_video_display_display_pixbuf", */
/* 		    G_TYPE_FROM_CLASS(klass), */
/* 		    G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION, */
/* 		    G_STRUCT_OFFSET(UnicapgtkVideoDisplayClass, unicapgtk_video_display), */
/* 		    NULL,  */
/* 		    NULL,                 */
/* 		    g_cclosure_marshal_VOID__POINTER, */
/* 		    G_TYPE_NONE, 1, */
/* 		    G_TYPE_POINTER ); */


   g_object_class_install_property (object_class,
				    PROP_SCALE_TO_FIT,
				    g_param_spec_boolean ("scale-to-fit",
                                                          NULL, NULL,
                                                          FALSE,
                                                          G_PARAM_READWRITE));
   g_object_class_install_property (object_class,
				    PROP_BACKEND,
				    g_param_spec_string ("backend",
                                                          NULL, NULL,
                                                          NULL,
                                                          G_PARAM_READWRITE ) );
   g_object_class_install_property (object_class,
				    PROP_FOURCC,
				    g_param_spec_uint ("backend_fourcc",
						       NULL, NULL,
						       0, 0xffffffff, 0, 
						       G_PARAM_READWRITE ) );
}