~ubuntu-branches/ubuntu/hardy/f-spot/hardy-proposed

« back to all changes in this revision

Viewing changes to glitz-sharp/src/Drawable.cs

  • Committer: Bazaar Package Importer
  • Author(s): Andrew Mitchell
  • Date: 2007-01-24 22:03:15 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20070124220315-8mozwksmqb9crf7m
Tags: 0.3.2-0ubuntu1
* New upstream release
  - New editing effects: Soft Focus and Straighten.
  - Lots of fixes to the OpenGL slideshow introduced in 0.3.1
  - Export to 23hq.com and SmugMug (Thomas Van Machelen)
  - Background color for transparent regions of images can be chosen 
    in --view mode (Stephane Delcroix)
  - New red-eye removal algorithm. Threshold value for redeye removal is 
    read from gconf. Default is set to -15 (Stephane Delcroix)
  - Zero-pad month and days while creating files and directories 
    (Stephane Delcroix)
  - In browse mode hjkl now behave just like left, down, up, right arrow
    keys do (Gabriel Burt)
  - Accepts dropped URIs from Firefox. Drag an image from Firefox and 
    drop it in f-spot --view (Stephane Delcroix)
  - Fullscreen mode uses overlayed controls, powered by compiz (Larry Ewing)
  - Fixes to histogram (Larry Ewing)
  - Initial work on color management (Larry Ewing)
  - Refactored multi service support (Larry Ewing)
  - More work on unit tests (Larry Ewing)
  - Other fixes and improvements

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright 2006 Alp Toker <alp@atoker.com>
 
2
// This software is made available under the MIT License
 
3
// See COPYING for details
 
4
 
 
5
using System;
 
6
 
 
7
namespace NDesk.Glitz
 
8
{
 
9
        public class Drawable : IDisposable
 
10
        {
 
11
                public IntPtr Handle;
 
12
 
 
13
                public Drawable (IntPtr handle)
 
14
                {
 
15
                        this.Handle = handle;
 
16
                        GlitzAPI.glitz_drawable_reference (Handle);
 
17
                }
 
18
 
 
19
                public Drawable (Drawable other, ref DrawableFormat format, uint width, uint height)
 
20
                {
 
21
                        this.Handle = GlitzAPI.glitz_create_drawable (other.Handle, ref format, width, height);
 
22
                        GlitzAPI.glitz_drawable_reference (Handle);
 
23
                }
 
24
 
 
25
                public static Drawable CreatePbuffer (Drawable other, ref DrawableFormat format, uint width, uint height)
 
26
                {
 
27
                        IntPtr Handle = GlitzAPI.glitz_create_pbuffer_drawable (other.Handle, ref format, width, height);
 
28
                        return new Drawable (Handle);
 
29
                }
 
30
 
 
31
                public void UpdateSize (uint width, uint height)
 
32
                {
 
33
                        GlitzAPI.glitz_drawable_update_size (Handle, width, height);
 
34
                }
 
35
 
 
36
                public void SwapBufferRegion (int x_origin, int y_origin, Box[] box)
 
37
                {
 
38
                        GlitzAPI.glitz_drawable_swap_buffer_region (Handle, x_origin, y_origin, box, box.Length);
 
39
                }
 
40
 
 
41
                public void SwapBuffers ()
 
42
                {
 
43
                        GlitzAPI.glitz_drawable_swap_buffers (Handle);
 
44
                }
 
45
 
 
46
                public void Flush ()
 
47
                {
 
48
                        GlitzAPI.glitz_drawable_flush (Handle);
 
49
                }
 
50
 
 
51
                public void Finish ()
 
52
                {
 
53
                        GlitzAPI.glitz_drawable_flush (Handle);
 
54
                }
 
55
 
 
56
                public FeatureMask Features {
 
57
                        get {
 
58
                                return GlitzAPI.glitz_drawable_get_features (Handle);
 
59
                        }
 
60
                }
 
61
 
 
62
                public IntPtr Format {
 
63
                        get {
 
64
                                return GlitzAPI.glitz_drawable_get_format (Handle);
 
65
                        }
 
66
                }
 
67
 
 
68
                public uint Width {
 
69
                        get {
 
70
                                return GlitzAPI.glitz_drawable_get_width (Handle);
 
71
                        }
 
72
                }
 
73
 
 
74
                public uint Height {
 
75
                        get {
 
76
                                return GlitzAPI.glitz_drawable_get_height (Handle);
 
77
                        }
 
78
                }
 
79
 
 
80
                public IntPtr FindStandardFormat (FormatName format_name)
 
81
                {
 
82
                        return GlitzAPI.glitz_find_standard_format (Handle, format_name);
 
83
                }
 
84
 
 
85
                ~Drawable ()
 
86
                {
 
87
                        Dispose (false);
 
88
                }
 
89
 
 
90
                void IDisposable.Dispose ()
 
91
                {
 
92
                        Dispose (true);
 
93
                        GC.SuppressFinalize (this);
 
94
                }
 
95
 
 
96
                protected virtual void Dispose (bool disposing)
 
97
                {
 
98
                        if (Handle == IntPtr.Zero)
 
99
                                return;
 
100
 
 
101
                        Console.WriteLine ("glitz_drawable_destroy");
 
102
                        GlitzAPI.glitz_drawable_destroy (Handle);
 
103
                        Handle = IntPtr.Zero;
 
104
                }
 
105
 
 
106
                public void Destroy()
 
107
                {
 
108
                        Dispose (true);
 
109
                }
 
110
 
 
111
                /*
 
112
                public void Destroy ()
 
113
                {
 
114
                        GlitzAPI.glitz_drawable_destroy (Handle);
 
115
                }
 
116
                */
 
117
        }
 
118
}