Changeset 538
- Timestamp:
- 07/15/08 16:55:25 (3 months ago)
- Files:
-
- trunk/demos/gtkD/TTextView.d (modified) (2 diffs)
- trunk/src/build/gtkD.d (modified) (1 diff)
- trunk/src/gdk/Pixbuf.d (modified) (12 diffs)
- trunk/src/gdk/Screen.d (modified) (5 diffs)
- trunk/src/gdkpixbuf/PixbufAnimation.d (modified) (3 diffs)
- trunk/src/gdkpixbuf/PixbufLoader.d (modified) (4 diffs)
- trunk/src/gdkpixbuf/Pixdata.d (modified) (4 diffs)
- trunk/src/glib/BookmarkFile.d (modified) (25 diffs)
- trunk/src/glib/CharacterSet.d (modified) (10 diffs)
- trunk/src/glib/Directory.d (modified) (3 diffs)
- trunk/src/glib/FileUtils.d (modified) (6 diffs)
- trunk/src/glib/GException.d (added)
- trunk/src/glib/IOChannel.d (modified) (14 diffs)
- trunk/src/glib/KeyFile.d (modified) (25 diffs)
- trunk/src/glib/MappedFile.d (modified) (3 diffs)
- trunk/src/glib/MatchInfo.d (modified) (4 diffs)
- trunk/src/glib/OptionContext.d (modified) (3 diffs)
- trunk/src/glib/Regex.d (modified) (10 diffs)
- trunk/src/glib/ShellUtils.d (modified) (4 diffs)
- trunk/src/glib/SimpleXML.d (modified) (6 diffs)
- trunk/src/glib/Spawn.d (modified) (6 diffs)
- trunk/src/glib/ThreadPool.d (modified) (5 diffs)
- trunk/src/glib/Unicode.d (modified) (8 diffs)
- trunk/src/gthread/Thread.d (modified) (4 diffs)
- trunk/src/gtk/Builder.d (modified) (6 diffs)
- trunk/src/gtk/FileChooserButton.d (modified) (2 diffs)
- trunk/src/gtk/FileChooserDialog.d (modified) (2 diffs)
- trunk/src/gtk/FileChooserIF.d (modified) (6 diffs)
- trunk/src/gtk/FileChooserT.d (modified) (6 diffs)
- trunk/src/gtk/FileChooserWidget.d (modified) (2 diffs)
- trunk/src/gtk/IconInfo.d (modified) (3 diffs)
- trunk/src/gtk/IconTheme.d (modified) (3 diffs)
- trunk/src/gtk/Main.d (modified) (3 diffs)
- trunk/src/gtk/PageSetup.d (modified) (5 diffs)
- trunk/src/gtk/PaperSize.d (modified) (3 diffs)
- trunk/src/gtk/PrintJob.d (modified) (4 diffs)
- trunk/src/gtk/PrintOperation.d (modified) (4 diffs)
- trunk/src/gtk/PrintSettings.d (modified) (5 diffs)
- trunk/src/gtk/RecentChooserDialog.d (modified) (2 diffs)
- trunk/src/gtk/RecentChooserIF.d (modified) (4 diffs)
- trunk/src/gtk/RecentChooserMenu.d (modified) (2 diffs)
- trunk/src/gtk/RecentChooserT.d (modified) (4 diffs)
- trunk/src/gtk/RecentChooserWidget.d (modified) (2 diffs)
- trunk/src/gtk/RecentManager.d (modified) (6 diffs)
- trunk/src/gtk/TextBuffer.d (modified) (3 diffs)
- trunk/src/gtk/TreeView.d (modified) (1 diff)
- trunk/src/gtk/UIManager.d (modified) (4 diffs)
- trunk/src/gtk/Window.d (modified) (4 diffs)
- trunk/src/gtkc/glib.d (modified) (1 diff)
- trunk/src/pango/PgAttribute.d (modified) (3 diffs)
- trunk/wrap/APILookupGLib.txt (modified) (17 diffs)
- trunk/wrap/APILookupGThread.txt (modified) (1 diff)
- trunk/wrap/APILookupGdk.txt (modified) (2 diffs)
- trunk/wrap/APILookupGdkPixbuf.txt (modified) (3 diffs)
- trunk/wrap/APILookupGtk.txt (modified) (22 diffs)
- trunk/wrap/APILookupPango.txt (modified) (1 diff)
- trunk/wrap/utils/GtkDClass.d (modified) (1 diff)
- trunk/wrap/utils/funct.d (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/demos/gtkD/TTextView.d
r535 r538 39 39 40 40 private import gtk.ComboBox; 41 42 private import glib.GException; 41 43 42 44 version(Tango) private import tango.io.Stdout; … … 268 270 try 269 271 { 270 pixbuf = new Pixbuf("images/gtk-logo-rgb.gif" , null);272 pixbuf = new Pixbuf("images/gtk-logo-rgb.gif"); 271 273 272 274 scaled = pixbuf.scaleSimple(32, 32, InterpType.BILINEAR); trunk/src/build/gtkD.d
r525 r538 30 30 private import glib.IOChannel; 31 31 private import glib.ErrorG; 32 private import glib.GException; 32 33 private import glib.Messages; 33 34 private import glib.MessageLog; trunk/src/gdk/Pixbuf.d
r530 r538 47 47 * imports: 48 48 * - glib.Str 49 * - glib.ErrorG 50 * - glib.GException 49 51 * - gdkpixbuf.PixbufFormat 50 52 * - gdk.Drawable … … 74 76 75 77 private import glib.Str; 78 private import glib.ErrorG; 79 private import glib.GException; 76 80 private import gdkpixbuf.PixbufFormat; 77 81 private import gdk.Drawable; … … 637 641 * copyPixels = Whether to copy the pixel data, or use direct pointers 638 642 * data for the resulting pixbuf 639 * error = GError return location, may be NULL to ignore errors640 */ 641 public this (int dataLength, byte* data, int copyPixels , GError** error)643 * Throws: GException on failure. 644 */ 645 public this (int dataLength, byte* data, int copyPixels) 642 646 { 643 647 // GdkPixbuf* gdk_pixbuf_new_from_inline (gint data_length, const guint8 *data, gboolean copy_pixels, GError **error); 644 auto p = gdk_pixbuf_new_from_inline(dataLength, data, copyPixels, error); 648 GError* err = null; 649 650 auto p = gdk_pixbuf_new_from_inline(dataLength, data, copyPixels, &err); 651 652 if (err !is null) 653 { 654 throw new GException( new ErrorG(err) ); 655 } 656 645 657 if(p is null) 646 658 { … … 797 809 * Params: 798 810 * filename = Name of file to load, in the GLib file name encoding 799 * error = Return location for an error800 */ 801 public this (string filename , GError** error)811 * Throws: GException on failure. 812 */ 813 public this (string filename) 802 814 { 803 815 // GdkPixbuf* gdk_pixbuf_new_from_file (const char *filename, GError **error); 804 auto p = gdk_pixbuf_new_from_file(Str.toStringz(filename), error); 816 GError* err = null; 817 818 auto p = gdk_pixbuf_new_from_file(Str.toStringz(filename), &err); 819 820 if (err !is null) 821 { 822 throw new GException( new ErrorG(err) ); 823 } 824 805 825 if(p is null) 806 826 { … … 821 841 * width = The width the image should have or -1 to not constrain the width 822 842 * height = The height the image should have or -1 to not constrain the height 823 * error = Return location for an error824 */ 825 public this (string filename, int width, int height , GError** error)843 * Throws: GException on failure. 844 */ 845 public this (string filename, int width, int height) 826 846 { 827 847 // GdkPixbuf* gdk_pixbuf_new_from_file_at_size (const char *filename, int width, int height, GError **error); 828 auto p = gdk_pixbuf_new_from_file_at_size(Str.toStringz(filename), width, height, error); 848 GError* err = null; 849 850 auto p = gdk_pixbuf_new_from_file_at_size(Str.toStringz(filename), width, height, &err); 851 852 if (err !is null) 853 { 854 throw new GException( new ErrorG(err) ); 855 } 856 829 857 if(p is null) 830 858 { … … 852 880 * height = The height the image should have or -1 to not constrain the height 853 881 * preserveAspectRatio = TRUE to preserve the image's aspect ratio 854 * error = Return location for an error855 */ 856 public this (string filename, int width, int height, int preserveAspectRatio , GError** error)882 * Throws: GException on failure. 883 */ 884 public this (string filename, int width, int height, int preserveAspectRatio) 857 885 { 858 886 // GdkPixbuf* gdk_pixbuf_new_from_file_at_scale (const char *filename, int width, int height, gboolean preserve_aspect_ratio, GError **error); 859 auto p = gdk_pixbuf_new_from_file_at_scale(Str.toStringz(filename), width, height, preserveAspectRatio, error); 887 GError* err = null; 888 889 auto p = gdk_pixbuf_new_from_file_at_scale(Str.toStringz(filename), width, height, preserveAspectRatio, &err); 890 891 if (err !is null) 892 { 893 throw new GException( new ErrorG(err) ); 894 } 895 860 896 if(p is null) 861 897 { … … 874 910 * optionKeys = name of options to set, NULL-terminated 875 911 * optionValues = values for named options 876 * error = return location for error, or NULL877 912 * Returns: whether an error was set 878 */ 879 public int savev(string filename, string type, char** optionKeys, char** optionValues, GError** error) 913 * Throws: GException on failure. 914 */ 915 public int savev(string filename, string type, char** optionKeys, char** optionValues) 880 916 { 881 917 // gboolean gdk_pixbuf_savev (GdkPixbuf *pixbuf, const char *filename, const char *type, char **option_keys, char **option_values, GError **error); 882 return gdk_pixbuf_savev(gdkPixbuf, Str.toStringz(filename), Str.toStringz(type), optionKeys, optionValues, error); 918 GError* err = null; 919 920 auto p = gdk_pixbuf_savev(gdkPixbuf, Str.toStringz(filename), Str.toStringz(type), optionKeys, optionValues, &err); 921 922 if (err !is null) 923 { 924 throw new GException( new ErrorG(err) ); 925 } 926 927 return p; 883 928 } 884 929 … … 890 935 * filename = name of file to save. 891 936 * type = name of file format. 892 * error = return location for error, or NULL893 937 * ... = list of key-value save options 894 938 * Returns: whether an error was set 895 */ 896 public int save(string filename, string type, GError** error, ... ) 939 * Throws: GException on failure. 940 */ 941 public int save(string filename, string type, ... ) 897 942 { 898 943 // gboolean gdk_pixbuf_save (GdkPixbuf *pixbuf, const char *filename, const char *type, GError **error, ...); 899 return gdk_pixbuf_save(gdkPixbuf, Str.toStringz(filename), Str.toStringz(type), error); 944 GError* err = null; 945 946 auto p = gdk_pixbuf_save(gdkPixbuf, Str.toStringz(filename), Str.toStringz(type), &err); 947 948 if (err !is null) 949 { 950 throw new GException( new ErrorG(err) ); 951 } 952 953 return p; 900 954 } 901 955 … … 914 968 * userData = user data to pass to the save function. 915 969 * type = name of file format. 916 * error = return location for error, or NULL917 970 * ... = list of key-value save options 918 971 * Returns: whether an error was set 919 */ 920 public int saveToCallback(GdkPixbufSaveFunc saveFunc, void* userData, string type, GError** error, ... ) 972 * Throws: GException on failure. 973 */ 974 public int saveToCallback(GdkPixbufSaveFunc saveFunc, void* userData, string type, ... ) 921 975 { 922 976 // gboolean gdk_pixbuf_save_to_callback (GdkPixbuf *pixbuf, GdkPixbufSaveFunc save_func, gpointer user_data, const char *type, GError **error, ...); 923 return gdk_pixbuf_save_to_callback(gdkPixbuf, saveFunc, userData, Str.toStringz(type), error); 977 GError* err = null; 978 979 auto p = gdk_pixbuf_save_to_callback(gdkPixbuf, saveFunc, userData, Str.toStringz(type), &err); 980 981 if (err !is null) 982 { 983 throw new GException( new ErrorG(err) ); 984 } 985 986 return p; 924 987 } 925 988 … … 936 999 * optionKeys = name of options to set, NULL-terminated 937 1000 * optionValues = values for named options 938 * error = return location for error, or NULL939 1001 * Returns: whether an error was set 940 */ 941 public int saveToCallbackv(GdkPixbufSaveFunc saveFunc, void* userData, string type, char** optionKeys, char** optionValues, GError** error) 1002 * Throws: GException on failure. 1003 */ 1004 public int saveToCallbackv(GdkPixbufSaveFunc saveFunc, void* userData, string type, char** optionKeys, char** optionValues) 942 1005 { 943 1006 // gboolean gdk_pixbuf_save_to_callbackv (GdkPixbuf *pixbuf, GdkPixbufSaveFunc save_func, gpointer user_data, const char *type, char **option_keys, char **option_values, GError **error); 944 return gdk_pixbuf_save_to_callbackv(gdkPixbuf, saveFunc, userData, Str.toStringz(type), optionKeys, optionValues, error); 1007 GError* err = null; 1008 1009 auto p = gdk_pixbuf_save_to_callbackv(gdkPixbuf, saveFunc, userData, Str.toStringz(type), optionKeys, optionValues, &err); 1010 1011 if (err !is null) 1012 { 1013 throw new GException( new ErrorG(err) ); 1014 } 1015 1016 return p; 945 1017 } 946 1018 … … 959 1031 * bufferSize = location to receive the size of the new buffer. 960 1032 * type = name of file format. 961 * error = return location for error, or NULL962 1033 * ... = list of key-value save options 963 1034 * Returns: whether an error was set 964 */ 965 public int saveToBuffer(char** buffer, uint* bufferSize, string type, GError** error, ... ) 1035 * Throws: GException on failure. 1036 */ 1037 public int saveToBuffer(char** buffer, uint* bufferSize, string type, ... ) 966 1038 { 967 1039 // gboolean gdk_pixbuf_save_to_buffer (GdkPixbuf *pixbuf, gchar **buffer, gsize *buffer_size, const char *type, GError **error, ...); 968 return gdk_pixbuf_save_to_buffer(gdkPixbuf, buffer, bufferSize, Str.toStringz(type), error); 1040 GError* err = null; 1041 1042 auto p = gdk_pixbuf_save_to_buffer(gdkPixbuf, buffer, bufferSize, Str.toStringz(type), &err); 1043 1044 if (err !is null) 1045 { 1046 throw new GException( new ErrorG(err) ); 1047 } 1048 1049 return p; 969 1050 } 970 1051 … … 979 1060 * optionKeys = name of options to set, NULL-terminated 980 1061 * optionValues = values for named options 981 * error = return location for error, or NULL982 1062 * Returns: whether an error was set 983 */ 984 public int saveToBufferv(char** buffer, uint* bufferSize, string type, char** optionKeys, char** optionValues, GError** error) 1063 * Throws: GException on failure. 1064 */ 1065 public int saveToBufferv(char** buffer, uint* bufferSize, string type, char** optionKeys, char** optionValues) 985 1066 { 986 1067 // gboolean gdk_pixbuf_save_to_bufferv (GdkPixbuf *pixbuf, gchar **buffer, gsize *buffer_size, const char *type, char **option_keys, char **option_values, GError **error); 987 return gdk_pixbuf_save_to_bufferv(gdkPixbuf, buffer, bufferSize, Str.toStringz(type), optionKeys, optionValues, error); 1068 GError* err = null; 1069 1070 auto p = gdk_pixbuf_save_to_bufferv(gdkPixbuf, buffer, bufferSize, Str.toStringz(type), optionKeys, optionValues, &err); 1071 1072 if (err !is null) 1073 { 1074 throw new GException( new ErrorG(err) ); 1075 } 1076 1077 return p; 988 1078 } 989 1079 trunk/src/gdk/Screen.d
r530 r538 44 44 * imports: 45 45 * - glib.Str 46 * - glib.ErrorG 47 * - glib.GException 46 48 * - cairo.FontOption 47 49 * - gdk.Screen … … 80 82 81 83 private import glib.Str; 84 private import glib.ErrorG; 85 private import glib.GException; 82 86 private import cairo.FontOption; 83 87 private import gdk.Screen; … … 758 762 * userData = user data for child_setup 759 763 * childPid = return location for child process ID, or NULL 760 * error = return location for error761 764 * Returns: TRUE on success, FALSE if error is set 762 */ 763 public int gdkSpawnOnScreen(string workingDirectory, char** argv, char** envp, GSpawnFlags flags, GSpawnChildSetupFunc childSetup, void* userData, int* childPid, GError** error) 765 * Throws: GException on failure. 766 */ 767 public int gdkSpawnOnScreen(string workingDirectory, char** argv, char** envp, GSpawnFlags flags, GSpawnChildSetupFunc childSetup, void* userData, int* childPid) 764 768 { 765 769 // gboolean gdk_spawn_on_screen (GdkScreen *screen, const gchar *working_directory, gchar **argv, gchar **envp, GSpawnFlags flags, GSpawnChildSetupFunc child_setup, gpointer user_data, gint *child_pid, GError **error); 766 return gdk_spawn_on_screen(gdkScreen, Str.toStringz(workingDirectory), argv, envp, flags, childSetup, userData, childPid, error); 770 GError* err = null; 771 772 auto p = gdk_spawn_on_screen(gdkScreen, Str.toStringz(workingDirectory), argv, envp, flags, childSetup, userData, childPid, &err); 773 774 if (err !is null) 775 { 776 throw new GException( new ErrorG(err) ); 777 } 778 779 return p; 767 780 } 768 781 … … 790 803 * standardError = return location for file descriptor to read child's 791 804 * stderr, or NULL 792 * error = return location for error793 805 * Returns: TRUE on success, FALSE if an error was set 794 */ 795 public int gdkSpawnOnScreenWithPipes(string workingDirectory, char** argv, char** envp, GSpawnFlags flags, GSpawnChildSetupFunc childSetup, void* userData, int* childPid, int* standardInput, int* standardOutput, int* standardError, GError** error) 806 * Throws: GException on failure. 807 */ 808 public int gdkSpawnOnScreenWithPipes(string workingDirectory, char** argv, char** envp, GSpawnFlags flags, GSpawnChildSetupFunc childSetup, void* userData, int* childPid, int* standardInput, int* standardOutput, int* standardError) 796 809 { 797 810 // gboolean gdk_spawn_on_screen_with_pipes (GdkScreen *screen, const gchar *working_directory, gchar **argv, gchar **envp, GSpawnFlags flags, GSpawnChildSetupFunc child_setup, gpointer user_data, gint *child_pid, gint *standard_input, gint *standard_output, gint *standard_error, GError **error); 798 return gdk_spawn_on_screen_with_pipes(gdkScreen, Str.toStringz(workingDirectory), argv, envp, flags, childSetup, userData, childPid, standardInput, standardOutput, standardError, error); 811 GError* err = null; 812 813 auto p = gdk_spawn_on_screen_with_pipes(gdkScreen, Str.toStringz(workingDirectory), argv, envp, flags, childSetup, userData, childPid, standardInput, standardOutput, standardError, &err); 814 815 if (err !is null) 816 { 817 throw new GException( new ErrorG(err) ); 818 } 819 820 return p; 799 821 } 800 822 … … 809 831 * Params: 810 832 * commandLine = a command line 811 * error = return location for errors812 833 * Returns: TRUE on success, FALSE if error is set. 813 */ 814 public int gdkSpawnCommandLineOnScreen(string commandLine, GError** error) 834 * Throws: GException on failure. 835 */ 836 public int gdkSpawnCommandLineOnScreen(string commandLine) 815 837 { 816 838 // gboolean gdk_spawn_command_line_on_screen (GdkScreen *screen, const gchar *command_line, GError **error); 817 return gdk_spawn_command_line_on_screen(gdkScreen, Str.toStringz(commandLine), error); 839 GError* err = null; 840 841 auto p = gdk_spawn_command_line_on_screen(gdkScreen, Str.toStringz(commandLine), &err); 842 843 if (err !is null) 844 { 845 throw new GException( new ErrorG(err) ); 846 } 847 848 return p; 818 849 } 819 850 } trunk/src/gdkpixbuf/PixbufAnimation.d
r530 r538 44 44 * omit signals: 45 45 * imports: 46 * - glib.ErrorG 47 * - glib.GException 46 48 * - glib.TimeVal 47 49 * - gdk.Pixbuf … … 63 65 64 66 67 private import glib.ErrorG; 68 private import glib.GException; 65 69 private import glib.TimeVal; 66 70 private import gdk.Pixbuf; … … 131 135 * Params: 132 136 * filename = Name of file to load, in the GLib file name encoding 133 * error = return location for error134 */ 135 public this (string filename , GError** error)137 * Throws: GException on failure. 138 */ 139 public this (string filename) 136 140 { 137 141 // GdkPixbufAnimation* gdk_pixbuf_animation_new_from_file (const char *filename, GError **error); 138 auto p = gdk_pixbuf_animation_new_from_file(Str.toStringz(filename), error); 142 GError* err = null; 143 144 auto p = gdk_pixbuf_animation_new_from_file(Str.toStringz(filename), &err); 145 146 if (err !is null) 147 { 148 throw new GException( new ErrorG(err) ); 149 } 150 139 151 if(p is null) 140 152 { trunk/src/gdkpixbuf/PixbufLoader.d
r530 r538 46 46 * imports: 47 47 * - gdkpixbuf.PixbufFormat 48 * - glib.ErrorG 49 * - glib.GException 48 50 * - gdk.Pixbuf 49 51 * - gdkpixbuf.PixbufAnimation … … 68 70 69 71 private import gdkpixbuf.PixbufFormat; 72 private import glib.ErrorG; 73 private import glib.GException; 70 74 private import gdk.Pixbuf; 71 75 private import gdkpixbuf.PixbufAnimation; … … 375 379 * buf = Pointer to image data. 376 380 * count = Length of the buf buffer in bytes. 377 * error = return location for errors378 381 * Returns: TRUE if the write was successful, or FALSE if the loadercannot parse the buffer. 379 */ 380 public int write(char* buf, uint count, GError** error) 382 * Throws: GException on failure. 383 */ 384 public int write(char* buf, uint count) 381 385 { 382 386 // gboolean gdk_pixbuf_loader_write (GdkPixbufLoader *loader, const guchar *buf, gsize count, GError **error); 383 return gdk_pixbuf_loader_write(gdkPixbufLoader, buf, count, error); 387 GError* err = null; 388 389 auto p = gdk_pixbuf_loader_write(gdkPixbufLoader, buf, count, &err); 390 391 if (err !is null) 392 { 393 throw new GException( new ErrorG(err) ); 394 } 395 396 return p; 384 397 } 385 398 … … 456 469 * to be finished, passing NULL for error to ignore it is 457 470 * reasonable. 458 * Params:459 * error = return location for a GError, or NULL to ignore errors460 471 * Returns: TRUE if all image data written so far was successfully passed out via the update_area signalSignal DetailsThe "area-prepared" signalvoid user_function (GdkPixbufLoader *loader, gpointer user_data) : Run LastThis signal is emitted when the pixbuf loader has allocated the pixbuf in the desired size. After this signal is emitted, applications can call gdk_pixbuf_loader_get_pixbuf() to fetch the partially-loaded pixbuf. 461 */ 462 public int close(GError** error) 472 * Throws: GException on failure. 473 */ 474 public int close() 463 475 { 464 476 // gboolean gdk_pixbuf_loader_close (GdkPixbufLoader *loader, GError **error); 465 return gdk_pixbuf_loader_close(gdkPixbufLoader, error); 477 GError* err = null; 478 479 auto p = gdk_pixbuf_loader_close(gdkPixbufLoader, &err); 480 481 if (err !is null) 482 { 483 throw new GException( new ErrorG(err) ); 484 } 485 486 return p; 466 487 } 467 488 } trunk/src/gdkpixbuf/Pixdata.d
r530 r538 44 44 * imports: 45 45 * - gdk.Pixbuf 46 * - glib.ErrorG 47 * - glib.GException 46 48 * - glib.StringG 47 49 * - glib.Str … … 62 64 63 65 private import gdk.Pixbuf; 66 private import glib.ErrorG; 67 private import glib.GException; 64 68 private import glib.StringG; 65 69 private import glib.Str; … … 134 138 * copyPixels = whether to copy raw pixel data; run-length encoded 135 139 * pixel data is always copied. 136 * error = location to store possible errors.137 140 * Returns: a new GdkPixbuf. 138 */ 139 public Pixbuf gdkPixbufFromPixdata(int copyPixels, GError** error) 141 * Throws: GException on failure. 142 */ 143 public Pixbuf gdkPixbufFromPixdata(int copyPixels) 140 144 { 141 145 // GdkPixbuf* gdk_pixbuf_from_pixdata (const GdkPixdata *pixdata, gboolean copy_pixels, GError **error); 142 auto p = gdk_pixbuf_from_pixdata(gdkPixdata, copyPixels, error); 146 GError* err = null; 147 148 auto p = gdk_pixbuf_from_pixdata(gdkPixdata, copyPixels, &err); 149 150 if (err !is null) 151 { 152 throw new GException( new ErrorG(err) ); 153 } 154 143 155 if(p is null) 144 156 { … … 174 186 * streamLength = length of the stream used for deserialization. 175 187 * stream = stream of bytes containing a serialized GdkPixdata structure. 176 * error = GError location to indicate failures (maybe NULL to ignore errors).177 188 * Returns: Upon successful deserialization TRUE is returned,FALSE otherwise. 178 */ 179 public int deserialize(uint streamLength, byte* stream, GError** error) 189 * Throws: GException on failure. 190 */ 191 public int deserialize(uint streamLength, byte* stream) 180 192 { 181 193 // gboolean gdk_pixdata_deserialize (GdkPixdata *pixdata, guint stream_length, const guint8 *stream, GError **error); 182 return gdk_pixdata_deserialize(gdkPixdata, streamLength, stream, error); 194 GError* err = null; 195 196 auto p = gdk_pixdata_deserialize(gdkPixdata, streamLength, stream, &err); 197 198 if (err !is null) 199 { 200 throw new GException( new ErrorG(err) ); 201 } 202 203 return p; 183 204 } 184 205 trunk/src/glib/BookmarkFile.d
r530 r538 43 43 * omit signals: 44 44 * imports: 45 * - glib.ErrorG 46 * - glib.GException 45 47 * - glib.Str 46 48 * structWrap: … … 57 59 58 60 61 private import glib.ErrorG; 62 private import glib.GException; 59 63 private import glib.Str; 60 64 … … 190 194 * Params: 191 195 * filename = the path of a filename to load, in the GLib file name encoding 192 * error = return location for a GError, or NULL193 196 * Returns: TRUE if a desktop bookmark file could be loaded 194 */ 195 public int loadFromFile(string filename, GError** error) 197 * Throws: GException on failure. 198 */ 199 public int loadFromFile(string filename) 196 200 { 197 201 // gboolean g_bookmark_file_load_from_file (GBookmarkFile *bookmark, const gchar *filename, GError **error); 198 return g_bookmark_file_load_from_file(gBookmarkFile, Str.toStringz(filename), error); 202 GError* err = null; 203 204 auto p = g_bookmark_file_load_from_file(gBookmarkFile, Str.toStringz(filename), &err); 205 206 if (err !is null) 207 { 208 throw new GException( new ErrorG(err) ); 209 } 210 211 return p; 199 212 } 200 213 … … 207 220 * data = desktop bookmarks loaded in memory 208 221 * length = the length of data in bytes 209 * error = return location for a GError, or NULL210 222 * Returns: TRUE if a desktop bookmark could be loaded. 211 */ 212 public int loadFromData(string data, uint length, GError** error) 223 * Throws: GException on failure. 224 */ 225 public int loadFromData(string data, uint length) 213 226 { 214 227 // gboolean g_bookmark_file_load_from_data (GBookmarkFile *bookmark, const gchar *data, gsize length, GError **error); 215 return g_bookmark_file_load_from_data(gBookmarkFile, Str.toStringz(data), length, error); 228 GError* err = null; 229 230 auto p = g_bookmark_file_load_from_data(gBookmarkFile, Str.toStringz(data), length, &err); 231 232 if (err !is null) 233 { 234 throw new GException( new ErrorG(err) ); 235 } 236 237 return p; 216 238 } 217 239 … … 227 249 * fullPath = return location for a string containing the full path 228 250 * of the file, or NULL 229 * error = return location for a GError, or NULL230 251 * Returns: TRUE if a key file could be loaded, FALSE othewise 231 */ 232 public int loadFromDataDirs(string file, char** fullPath, GError** error) 252 * Throws: GException on failure. 253 */ 254 public int loadFromDataDirs(string file, char** fullPath) 233 255 { 234 256 // gboolean g_bookmark_file_load_from_data_dirs (GBookmarkFile *bookmark, const gchar *file, gchar **full_path, GError **error); 235 return g_bookmark_file_load_from_data_dirs(gBookmarkFile, Str.toStringz(file), fullPath, error); 257 GError* err = null; 258 259 auto p = g_bookmark_file_load_from_data_dirs(gBookmarkFile, Str.toStringz(file), fullPath, &err); 260 261 if (err !is null) 262 { 263 throw new GException( new ErrorG(err) ); 264 } 265 266 return p; 236 267 } 237 268 … … 241 272 * Params: 242 273 * length = return location for the length of the returned string, or NULL 243 * error = return location for a GError, or NULL244 274 * Returns: a newly allocated string holding the contents of the GBookmarkFile 245 */ 246 public string toData(uint* length, GError** error) 275 * Throws: GException on failure. 276 */ 277 public string toData(uint* length) 247 278 { 248 279 // gchar* g_bookmark_file_to_data (GBookmarkFile *bookmark, gsize *length, GError **error); 249 return Str.toString(g_bookmark_file_to_data(gBookmarkFile, length, error)); 280 GError* err = null; 281 282 auto p = Str.toString(g_bookmark_file_to_data(gBookmarkFile, length, &err)); 283 284 if (err !is null) 285 { 286 throw new GException( new ErrorG(err) ); 287 } 288 289 return p; 250 290 } 251 291 … … 256 296 * Params: 257 297 * filename = path of the output file 258 * error = return location for a GError, or NULL259 298 * Returns: TRUE if the file was successfully written. 260 */ 261 public int toFile(string filename, GError** error) 299 * Throws: GException on failure. 300 */ 301 public int toFile(string filename) 262 302 { 263 303 // gboolean g_bookmark_file_to_file (GBookmarkFile *bookmark, const gchar *filename, GError **error); 264 return g_bookmark_file_to_file(gBookmarkFile, Str.toStringz(filename), error); 304 GError* err = null; 305 306 auto p = g_bookmark_file_to_file(gBookmarkFile, Str.toStringz(filename), &err); 307 308 if (err !is null) 309 { 310 throw new GException( new ErrorG(err) ); 311 } 312 313 return p; 265 314 } 266 315 … … 287 336 * uri = a valid URI 288 337 * group = the group name to be searched 289 * error = return location for a GError, or NULL290 338 * Returns: TRUE if group was found. 291 */ 292 public int hasGroup(string uri, string group, GError** error) 339 * Throws: GException on failure. 340 */ 341 public int hasGroup(string uri, string group) 293 342 { 294 343 // gboolean g_bookmark_file_has_group (GBookmarkFile *bookmark, const gchar *uri, const gchar *group, GError **error); 295 return g_bookmark_file_has_group(gBookmarkFile, Str.toStringz(uri), Str.toStringz(group), error); 344 GError* err = null; 345 346 auto p = g_bookmark_file_has_group(gBookmarkFile, Str.toStringz(uri), Str.toStringz(group), &err); 347 348 if (err !is null) 349 { 350 throw new GException( new ErrorG(err) ); 351 } 352 353 return p; 296 354 } 297 355 … … 305 363 * uri = a valid URI 306 364 * name = the name of the application 307 * error = return location for a GError or NULL308 365 * Returns: TRUE if the application name was found 309 */ 310 public int hasApplication(string uri, string name, GError** error) 366 * Throws: GException on failure. 367 */ 368 public int hasApplication(string uri, string name) 311 369 { 312 370 // gboolean g_bookmark_file_has_application (GBookmarkFile *bookmark, const gchar *uri, const gchar *name, GError **error); 313 return g_bookmark_file_has_application(gBookmarkFile, Str.toStringz(uri), Str.toStringz(name), error); 371 GError* err = null; 372 373 auto p = g_bookmark_file_has_application(gBookmarkFile, Str.toStringz(uri), Str.toStringz(name), &err); 374 375 if (err !is null) 376 { 377 throw new GException( new ErrorG(err) ); 378 } 379 380 return p; 314 381 } 315 382 … … 348 415 * Params: 349 416 * uri = a valid URI or NULL 350 * error = return location for a GError, or NULL351 417 * Returns: a newly allocated string or NULL if the specified URI cannot be found. 352 */ 353 public string getTitle(string uri, GError** error) 418 * Throws: GException on failure. 419 */ 420 public string getTitle(string uri) 354 421 { 355 422 // gchar* g_bookmark_file_get_title (GBookmarkFile *bookmark, const gchar *uri, GError **error); 356 return Str.toString(g_bookmark_file_get_title(gBookmarkFile, Str.toStringz(uri), error)); 423 GError* err = null; 424 425 auto p = Str.toString(g_bookmark_file_get_title(gBookmarkFile, Str.toStringz(uri), &err)); 426 427 if (err !is null) 428 { 429 throw new GException( new ErrorG(err) ); 430 } 431 432 return p; 357 433 } 358 434 … … 364 440 * Params: 365 441 * uri = a valid URI 366 * error = return location for a GError, or NULL367 442 * Returns: a newly allocated string or NULL if the specified URI cannot be found. 368 */ 369 public string getDescription(string uri, GError** error) 443 * Throws: GException on failure. 444 */ 445 public string getDescription(string uri) 370 446 { 371 447 // gchar* g_bookmark_file_get_description (GBookmarkFile *bookmark, const gchar *uri, GError **error); 372 return Str.toString(g_bookmark_file_get_description(gBookmarkFile, Str.toStringz(uri), error)); 448 GError* err = null; 449 450 auto p = Str.toString(g_bookmark_file_get_description(gBookmarkFile, Str.toStringz(uri), &err)); 451 452 if (err !is null) 453 { 454 throw new GException( new ErrorG(err) ); 455 } 456 457 return p; 373 458 } 374 459 … … 382 467 * Params: 383 468 * uri = a valid URI 384 * error = return location for a GError, or NULL385 469 * Returns: a newly allocated string or NULL if the specified URI cannot be found. 386 */ 387 public string getMimeType(string uri, GError** error) 470 * Throws: GException on failure. 471 */ 472 public string getMimeType(string uri) 388 473 { 389 474 // gchar* g_bookmark_file_get_mime_type (GBookmarkFile *bookmark, const gchar *uri, GError **error); 390 return Str.toString(g_bookmark_file_get_mime_type(gBookmarkFile, Str.toStringz(uri), error)); 475 GError* err = null; 476 477 auto p = Str.toString(g_bookmark_file_get_mime_type(gBookmarkFile, Str.toStringz(uri), &err)); 478 479 if (err !is null) 480 { 481 throw new GException( new ErrorG(err) ); 482 } 483 484 return p; 391 485 } 392 486 … … 400 494 * Params: 401 495 * uri = a valid URI 402 * error = return location f
