~ubuntu-branches/ubuntu/vivid/nip2/vivid-proposed

« back to all changes in this revision

Viewing changes to src/imagemodel.c

  • Committer: Bazaar Package Importer
  • Author(s): Jay Berkenbilt
  • Date: 2010-12-27 14:53:08 UTC
  • mfrom: (2.1.12 sid)
  • Revision ID: james.westby@ubuntu.com-20101227145308-vampjbuuft281j3l
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
132
132
        IM_FREE( imagemodel->font_name );
133
133
        IM_FREE( imagemodel->text );
134
134
        MANAGED_UNREF( imagemodel->text_mask );
 
135
        MANAGED_UNREF( imagemodel->nib );
135
136
 
136
137
        G_OBJECT_CLASS( parent_class )->dispose( gobject );
137
138
}
251
252
static void
252
253
imagemodel_conv_changed_cb( Conversion *conv, Imagemodel *imagemodel )
253
254
{
254
 
        imagemodel_refresh_ink( imagemodel, conv->ii );
 
255
        if( conv->ii )
 
256
                imagemodel_refresh_ink( imagemodel, conv->ii );
255
257
 
256
258
        iobject_changed( IOBJECT( imagemodel ) );
257
259
}
290
292
        imagemodel->show_status = DISPLAY_STATUS;
291
293
 
292
294
        imagemodel->show_paintbox = FALSE;
293
 
        imagemodel->nib = PAINTBOX_1ROUND;
 
295
        imagemodel->nib_radius = 0;
 
296
        imagemodel->nib = NULL;
294
297
        imagemodel->ink = NULL;
295
298
        imagemodel->font_name = im_strdup( NULL, PAINTBOX_FONT );
296
299
        imagemodel->text = NULL;
373
376
        Imagemodel *imagemodel;
374
377
 
375
378
        imagemodel = g_object_new( TYPE_IMAGEMODEL, NULL );
376
 
        imagemodel_link( imagemodel, iimage );
 
379
 
 
380
        if( iimage )
 
381
                imagemodel_link( imagemodel, iimage );
377
382
 
378
383
#ifdef DEBUG
379
384
        printf( "imagemodel_new: " );
524
529
        return( TRUE );
525
530
}
526
531
 
 
532
gboolean
 
533
imagemodel_refresh_nib( Imagemodel *imagemodel )
 
534
{
 
535
        MANAGED_UNREF( imagemodel->nib );
 
536
 
 
537
        if( !(imagemodel->nib = imageinfo_new_temp( main_imageinfogroup, 
 
538
                        reduce_context->heap, NULL, "t" )) ) 
 
539
                return( FALSE );
 
540
 
 
541
        MANAGED_REF( imagemodel->nib );
 
542
 
 
543
        if( !imageinfo_paint_nib( imagemodel->nib, imagemodel->nib_radius ) )
 
544
                return( FALSE );
 
545
 
 
546
        return( TRUE );
 
547
}
 
548
 
527
549
/* After a paint action: mark all subsequent things dirty, recalc if prefs say
528
550
 * so.
529
551
 */