From bccf57ab07d93235579adf8d6e5830481d9ea6e4 Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Sat, 19 Jun 2004 15:23:28 +0000 Subject: [PATCH] Add contribution from kerrick@asu.edu svn path=/trunk/gtk-sharp/; revision=29944 --- doc/en/Gdk/Pixdata.xml | 91 +++++++++++++++++++++++++----------- doc/en/Gtk/MessageDialog.xml | 22 ++++++++- 2 files changed, 86 insertions(+), 27 deletions(-) diff --git a/doc/en/Gdk/Pixdata.xml b/doc/en/Gdk/Pixdata.xml index 207c02c29..3ad02ac33 100644 --- a/doc/en/Gdk/Pixdata.xml +++ b/doc/en/Gdk/Pixdata.xml @@ -10,8 +10,8 @@ Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - To be added - To be added + Contains functions for inlined pixbuf handling. It allows for pixbuf data to be accessed in a raw form, serialized, and stored. + At the time of this writing, gtk-sharp 0.98 has a bug where and use where Byte [] should be used making them function improperly. This problem should be fixed in a future release. System.ValueType @@ -27,7 +27,7 @@ - To be added + A blank Gdk.Pixdata, equivilent to Gdk.Pixdata Zero = new Gdk.Pixdata (); To be added @@ -41,9 +41,9 @@ - To be added - To be added: an object of type 'IntPtr' - To be added: an object of type 'Gdk.Pixdata' + Creates a new Gdk.Pixdata from a pointer to a raw GdkPixdata. + An pointing to a raw GdkPixdata. + A new 'Gdk.Pixdata' synonymous with the "raw" parameter. To be added @@ -58,10 +58,10 @@ - To be added - To be added: an object of type 'Gdk.Pixbuf' - To be added: an object of type 'bool' - To be added: an object of type 'IntPtr' + Fils in the Gdk.Pixdata with data from an existing . + The 'Gdk.Pixbuf' which the Gdk.Pixdata is to be derived from. + Whether to use run-length encoding for the pixel data. + If "ure_rle" is set to true, an pointing to the new run-length encoded pixel data is returned, otherwise, To be added @@ -76,11 +76,11 @@ - To be added - a + Converts a serialized datastream, generated by , into pixdata. + A describing the length of "stream". a - a - To be added + A . True is successful, false if there was an error. + As of gtk-sharp 0.98, this function uses a for "stream" when it should be using a Byte []. Until this is fixed, this function will not work as intended. @@ -93,10 +93,10 @@ - To be added - a + Generates serialized pixdata that can then be stored and converted back into a with . + A set to the length of the returned []. a - To be added + As of gtk-sharp 0.98, this function returns a when it should be returning a Byte []. Until this is fixed, this function will not work as intended. @@ -108,8 +108,8 @@ - To be added - To be added + The GdkPixbuf magic number. + All valid Gdk.Pixdata objects must have this set to 0x47646b50, which is 'GdkP' in ASCII. @@ -121,8 +121,8 @@ - To be added - To be added + The length of the raw structure. + This is either set to less than one to disable length checks or set to the length of the raw GdkPixbuf header, which is currently 24, plus the length of the pixel data. @@ -134,8 +134,47 @@ - To be added - To be added + An enumeration containing three sets of flax for the . One used for colorspace, one for the width of the samples, and one for the encoding of the pixel data. + + + + Value + Description + + + 0x01 + Each pixel has red, green, and blue samples. + + + 0x02 + Each pixel has red, green, and blue samples, and an alpha value. + + + 0xFF + A mask for the colortype flags. + + + 0x01 << 16 + Each sample has 8 bits. + + + 0x0f << 16 + A mask for the sample width flags. + + + 0x01 << 24 + The pixel data is in raw form. + + + 0x02 << 24 + The pixel data is run-length encoded. Runs may be up to 127 bytes long; their length is stored in a single byte preceding the pixel data for the run. If a run is constant, its length byte has the high bit set and the pixel data consists of a single pixel which must be repeated. + + + 0x0f << 24 + A mask for the encoding flags. + + + @@ -147,7 +186,7 @@ - To be added + The distance in bytes between rows. To be added @@ -160,7 +199,7 @@ - To be added + The width of the image in pixels. To be added @@ -173,7 +212,7 @@ - To be added + The height of the image in pixels. To be added diff --git a/doc/en/Gtk/MessageDialog.xml b/doc/en/Gtk/MessageDialog.xml index d86ce2236..095e71c3a 100644 --- a/doc/en/Gtk/MessageDialog.xml +++ b/doc/en/Gtk/MessageDialog.xml @@ -26,7 +26,9 @@ in the is clicked or the is closed. - A message dialog + After returns, you are responsible for hiding (using ) or destroying (using ) the dialog if you wish to do so. + + A simple message dialog MessageDialog md = new MessageDialog (parent_window, @@ -35,6 +37,24 @@ MessageDialog md = new MessageDialog (parent_window, ButtonsType.Close, "Error loading file"); int result = md.Run (); +md.Destroy(); + + + + A yes/no message dialog + + +MessageDialog md = new MessageDialog (parent_window, + DialogFlags.DestroyWithParent, + MessageType.Question, + ButtonsType.YesNo, "Are you sure you want to quit?"); + +ResponseType result = (ResponseType)md.Run (); + +if (result == ResponseType.Yes) + Application.Quit(); +else + md.Destroy();