From: <wda...@us...> - 2008-03-18 14:11:09
|
Revision: 2402 http://oorexx.svn.sourceforge.net/oorexx/?rev=2402&view=rev Author: wdashley Date: 2008-03-18 07:11:05 -0700 (Tue, 18 Mar 2008) Log Message: ----------- ArtifactID: None Comment: Added image support to GtkTextBuffer and an example. Modified Paths: -------------- sandbox/david/grxtextbuffer.c sandbox/david/rexxgtk.c sandbox/david/rexxgtk.cls Added Paths: ----------- sandbox/david/test7-8.rex sandbox/david/test7-8a.rex Modified: sandbox/david/grxtextbuffer.c =================================================================== --- sandbox/david/grxtextbuffer.c 2008-03-17 16:16:43 UTC (rev 2401) +++ sandbox/david/grxtextbuffer.c 2008-03-18 14:11:05 UTC (rev 2402) @@ -529,7 +529,7 @@ /*----------------------------------------------------------------------------*/ -/* Rexx External Function: GrxTextBufferRemoveAllTagse */ +/* Rexx External Function: GrxTextBufferRemoveAllTags */ /* Description: Remove all tags from the current selection */ /* Rexx Args: Pointer to the text buffer */ /*----------------------------------------------------------------------------*/ @@ -561,6 +561,47 @@ /*----------------------------------------------------------------------------*/ +/* Rexx External Function: GrxTextBufferInsertImage */ +/* Description: Insert a pixbuf into the text buffer */ +/* Rexx Args: Pointer to the text buffer */ +/* Pointer to the image */ +/* Line number */ +/*----------------------------------------------------------------------------*/ + +APIRET APIENTRY GrxTextBufferInsertImage(const char * Name, + const size_t Argc, const RXSTRING Argv[], + const char * Queuename, PRXSTRING Retstr) +{ + GtkTextBuffer *myWidget; + GtkTextIter line; + GdkPixbuf *pixbuf; + GtkImage *img; + gint linenum; + + /* Check for valid arguments */ + if (Argc < 3) { + return RXFUNC_BADCALL; + } + + /* Initialize function parameters */ + sscanf(Argv[0].strptr, "%p", &myWidget); + sscanf(Argv[1].strptr, "%p", &img); + sscanf(Argv[2].strptr, "%d", &linenum); + + printf("image = %p\n", img); + pixbuf = gtk_image_get_pixbuf(img); + gtk_text_buffer_get_iter_at_line(myWidget, &line, linenum); + gtk_text_buffer_insert_pixbuf(myWidget, &line, pixbuf); + + /* Set up the REXX return code */ + *(Retstr->strptr) = '0'; + Retstr->strlength = 1; + + return RXFUNC_OK; +} + + +/*----------------------------------------------------------------------------*/ /* Rexx External Function: GrxTextBufferonnectSignal */ /* Description: Connect a signal function to the Widget */ /* Rexx Args: Pointer to the widget */ Modified: sandbox/david/rexxgtk.c =================================================================== --- sandbox/david/rexxgtk.c 2008-03-17 16:16:43 UTC (rev 2401) +++ sandbox/david/rexxgtk.c 2008-03-18 14:11:05 UTC (rev 2402) @@ -361,6 +361,7 @@ "GrxTextBufferCreateTagFloat", "GrxTextBufferApplyTagByName", "GrxTextBufferRemoveAllTags", + "GrxTextBufferInsertImage", "GrxTextBufferConnectSignal", //Scrolled window functions Modified: sandbox/david/rexxgtk.cls =================================================================== --- sandbox/david/rexxgtk.cls 2008-03-17 16:16:43 UTC (rev 2401) +++ sandbox/david/rexxgtk.cls 2008-03-18 14:11:05 UTC (rev 2402) @@ -110,227 +110,227 @@ ::routine GTK_Constant public use strict arg id -id = upper(id) +tid = upper(id) select -- GtkWindowType - when id = 'GTK_WINDOW_TOPLEVEL' then return 0 - when id = 'GTK_WINDOW_POPUP' then return 1 + when tid = 'GTK_WINDOW_TOPLEVEL' then return 0 + when tid = 'GTK_WINDOW_POPUP' then return 1 -- GtkButtonType - when id = 'GTK_BUTTONS_NONE' then return 0 - when id = 'GTK_BUTTONS_OK' then return 1 - when id = 'GTK_BUTTONS_CLOSE' then return 2 - when id = 'GTK_BUTTONS_CANCEL' then return 3 - when id = 'GTK_BUTTONS_YES_NO' then return 4 - when id = 'GTK_BUTTONS_OK_CANCEL' then return 5 + when tid = 'GTK_BUTTONS_NONE' then return 0 + when tid = 'GTK_BUTTONS_OK' then return 1 + when tid = 'GTK_BUTTONS_CLOSE' then return 2 + when tid = 'GTK_BUTTONS_CANCEL' then return 3 + when tid = 'GTK_BUTTONS_YES_NO' then return 4 + when tid = 'GTK_BUTTONS_OK_CANCEL' then return 5 -- GtkDialogFlags - when id = 'GTK_DIALOG_MODAL' then return 2**0 - when id = 'GTK_DIALOG_DESTROY_WITH_PARENT' then return 2**1 - when id = 'GTK_DIALOG_NO_SEPARATOR' then return 2**2 + when tid = 'GTK_DIALOG_MODAL' then return 2**0 + when tid = 'GTK_DIALOG_DESTROY_WITH_PARENT' then return 2**1 + when tid = 'GTK_DIALOG_NO_SEPARATOR' then return 2**2 -- GtkResponseType - when id = 'GTK_RESPONSE_NONE' then return -1 - when id = 'GTK_RESPONSE_REJECT' then return -2 - when id = 'GTK_RESPONSE_ACCEPT' then return -3 - when id = 'GTK_RESPONSE_DELETE_EVENT' then return -4 - when id = 'GTK_RESPONSE_OK' then return -5 - when id = 'GTK_RESPONSE_CANCEL' then return -6 - when id = 'GTK_RESPONSE_CLOSE' then return -7 - when id = 'GTK_RESPONSE_YES' then return -8 - when id = 'GTK_RESPONSE_NO' then return -9 - when id = 'GTK_RESPONSE_APPLY' then return -10 - when id = 'GTK_RESPONSE_HELP' then return -11 + when tid = 'GTK_RESPONSE_NONE' then return -1 + when tid = 'GTK_RESPONSE_REJECT' then return -2 + when tid = 'GTK_RESPONSE_ACCEPT' then return -3 + when tid = 'GTK_RESPONSE_DELETE_EVENT' then return -4 + when tid = 'GTK_RESPONSE_OK' then return -5 + when tid = 'GTK_RESPONSE_CANCEL' then return -6 + when tid = 'GTK_RESPONSE_CLOSE' then return -7 + when tid = 'GTK_RESPONSE_YES' then return -8 + when tid = 'GTK_RESPONSE_NO' then return -9 + when tid = 'GTK_RESPONSE_APPLY' then return -10 + when tid = 'GTK_RESPONSE_HELP' then return -11 -- GtkMessageType - when id = 'GTK_MESSAGE_INFO' then return 0 - when id = 'GTK_MESSAGE_WARNING' then return 1 - when id = 'GTK_MESSAGE_QUESTION' then return 2 - when id = 'GTK_MESSAGE_ERROR' then return 3 - when id = 'GTK_MESSAGE_OTHER' then return 4 + when tid = 'GTK_MESSAGE_INFO' then return 0 + when tid = 'GTK_MESSAGE_WARNING' then return 1 + when tid = 'GTK_MESSAGE_QUESTION' then return 2 + when tid = 'GTK_MESSAGE_ERROR' then return 3 + when tid = 'GTK_MESSAGE_OTHER' then return 4 -- GTK stock string defines - when id = 'GTK_STOCK_ABOUT' then return 'gtk-about' - when id = 'GTK_STOCK_ADD' then return 'gtk-add' - when id = 'GTK_STOCK_APPLY' then return 'gtk-apply' - when id = 'GTK_STOCK_BOLD' then return 'gtk-bold' - when id = 'GTK_STOCK_CANCEL' then return 'gtk-cancel' - when id = 'GTK_STOCK_CDROM' then return 'gtk-cdrom' - when id = 'GTK_STOCK_CLEAR' then return 'gtk-clear' - when id = 'GTK_STOCK_CLOSE' then return 'gtk-close' - when id = 'GTK_STOCK_COLOR_PICKER' then return 'gtk-color-picker' - when id = 'GTK_STOCK_CONVERT' then return 'gtk-comvert' - when id = 'GTK_STOCK_CONNECT' then return 'gtk-connect' - when id = 'GTK_STOCK_COPY' then return 'gtk-copy' - when id = 'GTK_STOCK_CUT' then return 'gtk-cut' - when id = 'GTK_STOCK_DELETE' then return 'gtk-delete' - when id = 'GTK_STOCK_DIALOG_ERROR' then return 'gtk-dialog-error' - when id = 'GTK_STOCK_DIALOG_INFO' then return 'gtk-dialog-info' - when id = 'GTK_STOCK_DIALOG_QUESTION' then return 'gtk-dialog-question' - when id = 'GTK_STOCK_DIALOG_WARNING' then return 'gtk-dialog-warning' - when id = 'GTK_STOCK_DIRECTORY' then return 'gtk-directry' - when id = 'GTK_STOCK_DISCARD' then return 'gtk-discard' - when id = 'GTK_STOCK_DISCONNECT' then return 'gtk-disconnect' - when id = 'GTK_STOCK_DND' then return 'gtk-dnd' - when id = 'GTK_STOCK_DND_MULTIPLE' then return 'gtk-dnd-multiple' - when id = 'GTK_STOCK_EDIT' then return 'gtk-edit' - when id = 'GTK_STOCK_EXECUTE' then return 'gtk-execute' - when id = 'GTK_STOCK_FILE' then return 'gtk-file' - when id = 'GTK_STOCK_FIND' then return 'gtk-find' - when id = 'GTK_STOCK_FIND_AND_REPLACE' then return 'gtk-find-and-replace' - when id = 'GTK_STOCK_FLOPPY' then return 'gtk-floppy' - when id = 'GTK_STOCK_FULLSCREEN' then return 'gtk-fullscreen' - when id = 'GTK_STOCK_GOTO_BOTTOM' then return 'gtk-goto-bottom' - when id = 'GTK_STOCK_GOTO_FIRST' then return 'gtk-goto-first' - when id = 'GTK_STOCK_GOTO_LAST' then return 'gtk-goto-last' - when id = 'GTK_STOCK_GOTO_TOP' then return 'gtk-goto-top' - when id = 'GTK_STOCK_GO_BACK' then return 'gtk-go-back' - when id = 'GTK_STOCK_GO_DOWN' then return 'gtk-go-down' - when id = 'GTK_STOCK_GO_FORWARD' then return 'gtk-go-forward' - when id = 'GTK_STOCK_GO_UP' then return 'gtk-go-up' - when id = 'GTK_STOCK_HARDDISK' then return 'gtk-harddisk' - when id = 'GTK_STOCK_HELP' then return 'gtk-help' - when id = 'GTK_STOCK_HOME' then return 'gtk-home' - when id = 'GTK_STOCK_INDENT' then return 'gtk-indent' - when id = 'GTK_STOCK_INDEX' then return 'gtk-index' - when id = 'GTK_STOCK_INFO' then return 'gtk-info' - when id = 'GTK_STOCK_ITALIC' then return 'gtk-italic' - when id = 'GTK_STOCK_JUMP_TO' then return 'gtk-jump-to' - when id = 'GTK_STOCK_JUSTIFY_CENTER' then return 'gtk-justify-center' - when id = 'GTK_STOCK_JUSTIFY_FILL' then return 'gtk-justify-fill' - when id = 'GTK_STOCK_JUSTIFY_LEFT' then return 'gtk-justify-left' - when id = 'GTK_STOCK_JUSTIFY_RIGHT' then return 'gtk-justify-right' - when id = 'GTK_STOCK_LEAVE_FULLSCREEN' then return 'gtk-leave-fullscreen' - when id = 'GTK_STOCK_MEDIA_FORWARD' then return 'gtk-media-forward' - when id = 'GTK_STOCK_MEDIA_NEXT' then return 'gtk-media-nect' - when id = 'GTK_STOCK_MEDIA_PAUSE' then return 'gtk-media-pause' - when id = 'GTK_STOCK_MEDIA_PLAY' then return 'gtk-media-play' - when id = 'GTK_STOCK_MEDIA_PREVIOUS' then return 'gtk-media-previous' - when id = 'GTK_STOCK_MEDIA_RECORD' then return 'gtk-media-record' - when id = 'GTK_STOCK_MEDIA_REWIND' then return 'gtk-media-rewind' - when id = 'GTK_STOCK_MEDIA_STOP' then return 'gtk-media-stop' - when id = 'GTK_STOCK_MISSING_IMAGE' then return 'gtk-missing-image' - when id = 'GTK_STOCK_NETWORK' then return 'gtk-network' - when id = 'GTK_STOCK_NEW' then return 'gtk-new' - when id = 'GTK_STOCK_NO' then return 'gtk-no' - when id = 'GTK_STOCK_OK' then return 'gtk-ok' - when id = 'GTK_STOCK_OPEN' then return 'gtk-open' - when id = 'GTK_STOCK_OREINTATION_LANDSCAPE' then return 'gtk-orientation-landscape' - when id = 'GTK_STOCK_OREINTATION_PORTRAIT' then return 'gtk-orientation-portrait' - when id = 'GTK_STOCK_OREINTATION_REVERSE_LANDSCAPE' then return 'gtk-orientation-reverse-landscape' - when id = 'GTK_STOCK_OREINTATION_REVERSE_LANDSCAPE' then return 'gtk-orientation-reverse-portrait' - when id = 'GTK_STOCK_PASTE' then return 'gtk-paste' - when id = 'GTK_STOCK_PREFERENCES' then return 'gtk-preferences' - when id = 'GTK_STOCK_PRINT' then return 'gtk-print' - when id = 'GTK_STOCK_PRINT_PREVIEW' then return 'gtk-print-preview' - when id = 'GTK_STOCK_PROPERTIES' then return 'gtk-properties' - when id = 'GTK_STOCK_QUIT' then return 'gtk-quit' - when id = 'GTK_STOCK_REDO' then return 'gtk-redo' - when id = 'GTK_STOCK_REFRESH' then return 'gtk-refresh' - when id = 'GTK_STOCK_REMOVE' then return 'gtk-remove' - when id = 'GTK_STOCK_REVERT_TO_SAVED' then return 'gtk-revert-to-saved' - when id = 'GTK_STOCK_SAVE' then return 'gtk-save' - when id = 'GTK_STOCK_SAVE_AS' then return 'gtk-save-as' - when id = 'GTK_STOCK_SELECT_ALL' then return 'gtk-select-all' - when id = 'GTK_STOCK_SELECT_COLOR' then return 'gtk-select-color' - when id = 'GTK_STOCK_SELECT_FONT' then return 'gtk-select-font' - when id = 'GTK_STOCK_SORT_ASCENDING' then return 'gtk-sort-ascending' - when id = 'GTK_STOCK_SORT_DESCENDING' then return 'gtk-sort-descending' - when id = 'GTK_STOCK_SPELL_CHECK' then return 'gtk-spell-check' - when id = 'GTK_STOCK_STOP' then return 'gtk-stop' - when id = 'GTK_STOCK_STRIKETHROUGH' then return 'gtk-strikethrough' - when id = 'GTK_STOCK_UNDELETE' then return 'gtk-undelete' - when id = 'GTK_STOCK_UNDERLINE' then return 'gtk-underline' - when id = 'GTK_STOCK_UNDO' then return 'gtk-undo' - when id = 'GTK_STOCK_UNINDENT' then return 'gtk-unindent' - when id = 'GTK_STOCK_YES' then return 'gtk-yes' - when id = 'GTK_STOCK_ZOOM_100' then return 'gtk-zoom-100' - when id = 'GTK_STOCK_ZOOM_FIT' then return 'gtk-zoom-fit' - when id = 'GTK_STOCK_ZOOM_IN' then return 'gtk-zoom-in' - when id = 'GTK_STOCK_ZOOM_OUT' then return 'gtk-zoom-out' + when tid = 'GTK_STOCK_ABOUT' then return 'gtk-about' + when tid = 'GTK_STOCK_ADD' then return 'gtk-add' + when tid = 'GTK_STOCK_APPLY' then return 'gtk-apply' + when tid = 'GTK_STOCK_BOLD' then return 'gtk-bold' + when tid = 'GTK_STOCK_CANCEL' then return 'gtk-cancel' + when tid = 'GTK_STOCK_CDROM' then return 'gtk-cdrom' + when tid = 'GTK_STOCK_CLEAR' then return 'gtk-clear' + when tid = 'GTK_STOCK_CLOSE' then return 'gtk-close' + when tid = 'GTK_STOCK_COLOR_PICKER' then return 'gtk-color-picker' + when tid = 'GTK_STOCK_CONVERT' then return 'gtk-comvert' + when tid = 'GTK_STOCK_CONNECT' then return 'gtk-connect' + when tid = 'GTK_STOCK_COPY' then return 'gtk-copy' + when tid = 'GTK_STOCK_CUT' then return 'gtk-cut' + when tid = 'GTK_STOCK_DELETE' then return 'gtk-delete' + when tid = 'GTK_STOCK_DIALOG_ERROR' then return 'gtk-dialog-error' + when tid = 'GTK_STOCK_DIALOG_INFO' then return 'gtk-dialog-info' + when tid = 'GTK_STOCK_DIALOG_QUESTION' then return 'gtk-dialog-question' + when tid = 'GTK_STOCK_DIALOG_WARNING' then return 'gtk-dialog-warning' + when tid = 'GTK_STOCK_DIRECTORY' then return 'gtk-directry' + when tid = 'GTK_STOCK_DISCARD' then return 'gtk-discard' + when tid = 'GTK_STOCK_DISCONNECT' then return 'gtk-disconnect' + when tid = 'GTK_STOCK_DND' then return 'gtk-dnd' + when tid = 'GTK_STOCK_DND_MULTIPLE' then return 'gtk-dnd-multiple' + when tid = 'GTK_STOCK_EDIT' then return 'gtk-edit' + when tid = 'GTK_STOCK_EXECUTE' then return 'gtk-execute' + when tid = 'GTK_STOCK_FILE' then return 'gtk-file' + when tid = 'GTK_STOCK_FIND' then return 'gtk-find' + when tid = 'GTK_STOCK_FIND_AND_REPLACE' then return 'gtk-find-and-replace' + when tid = 'GTK_STOCK_FLOPPY' then return 'gtk-floppy' + when tid = 'GTK_STOCK_FULLSCREEN' then return 'gtk-fullscreen' + when tid = 'GTK_STOCK_GOTO_BOTTOM' then return 'gtk-goto-bottom' + when tid = 'GTK_STOCK_GOTO_FIRST' then return 'gtk-goto-first' + when tid = 'GTK_STOCK_GOTO_LAST' then return 'gtk-goto-last' + when tid = 'GTK_STOCK_GOTO_TOP' then return 'gtk-goto-top' + when tid = 'GTK_STOCK_GO_BACK' then return 'gtk-go-back' + when tid = 'GTK_STOCK_GO_DOWN' then return 'gtk-go-down' + when tid = 'GTK_STOCK_GO_FORWARD' then return 'gtk-go-forward' + when tid = 'GTK_STOCK_GO_UP' then return 'gtk-go-up' + when tid = 'GTK_STOCK_HARDDISK' then return 'gtk-harddisk' + when tid = 'GTK_STOCK_HELP' then return 'gtk-help' + when tid = 'GTK_STOCK_HOME' then return 'gtk-home' + when tid = 'GTK_STOCK_INDENT' then return 'gtk-indent' + when tid = 'GTK_STOCK_INDEX' then return 'gtk-index' + when tid = 'GTK_STOCK_INFO' then return 'gtk-info' + when tid = 'GTK_STOCK_ITALIC' then return 'gtk-italic' + when tid = 'GTK_STOCK_JUMP_TO' then return 'gtk-jump-to' + when tid = 'GTK_STOCK_JUSTIFY_CENTER' then return 'gtk-justify-center' + when tid = 'GTK_STOCK_JUSTIFY_FILL' then return 'gtk-justify-fill' + when tid = 'GTK_STOCK_JUSTIFY_LEFT' then return 'gtk-justify-left' + when tid = 'GTK_STOCK_JUSTIFY_RIGHT' then return 'gtk-justify-right' + when tid = 'GTK_STOCK_LEAVE_FULLSCREEN' then return 'gtk-leave-fullscreen' + when tid = 'GTK_STOCK_MEDIA_FORWARD' then return 'gtk-media-forward' + when tid = 'GTK_STOCK_MEDIA_NEXT' then return 'gtk-media-nect' + when tid = 'GTK_STOCK_MEDIA_PAUSE' then return 'gtk-media-pause' + when tid = 'GTK_STOCK_MEDIA_PLAY' then return 'gtk-media-play' + when tid = 'GTK_STOCK_MEDIA_PREVIOUS' then return 'gtk-media-previous' + when tid = 'GTK_STOCK_MEDIA_RECORD' then return 'gtk-media-record' + when tid = 'GTK_STOCK_MEDIA_REWIND' then return 'gtk-media-rewind' + when tid = 'GTK_STOCK_MEDIA_STOP' then return 'gtk-media-stop' + when tid = 'GTK_STOCK_MISSING_IMAGE' then return 'gtk-missing-image' + when tid = 'GTK_STOCK_NETWORK' then return 'gtk-network' + when tid = 'GTK_STOCK_NEW' then return 'gtk-new' + when tid = 'GTK_STOCK_NO' then return 'gtk-no' + when tid = 'GTK_STOCK_OK' then return 'gtk-ok' + when tid = 'GTK_STOCK_OPEN' then return 'gtk-open' + when tid = 'GTK_STOCK_OREINTATION_LANDSCAPE' then return 'gtk-orientation-landscape' + when tid = 'GTK_STOCK_OREINTATION_PORTRAIT' then return 'gtk-orientation-portrait' + when tid = 'GTK_STOCK_OREINTATION_REVERSE_LANDSCAPE' then return 'gtk-orientation-reverse-landscape' + when tid = 'GTK_STOCK_OREINTATION_REVERSE_LANDSCAPE' then return 'gtk-orientation-reverse-portrait' + when tid = 'GTK_STOCK_PASTE' then return 'gtk-paste' + when tid = 'GTK_STOCK_PREFERENCES' then return 'gtk-preferences' + when tid = 'GTK_STOCK_PRINT' then return 'gtk-print' + when tid = 'GTK_STOCK_PRINT_PREVIEW' then return 'gtk-print-preview' + when tid = 'GTK_STOCK_PROPERTIES' then return 'gtk-properties' + when tid = 'GTK_STOCK_QUIT' then return 'gtk-quit' + when tid = 'GTK_STOCK_REDO' then return 'gtk-redo' + when tid = 'GTK_STOCK_REFRESH' then return 'gtk-refresh' + when tid = 'GTK_STOCK_REMOVE' then return 'gtk-remove' + when tid = 'GTK_STOCK_REVERT_TO_SAVED' then return 'gtk-revert-to-saved' + when tid = 'GTK_STOCK_SAVE' then return 'gtk-save' + when tid = 'GTK_STOCK_SAVE_AS' then return 'gtk-save-as' + when tid = 'GTK_STOCK_SELECT_ALL' then return 'gtk-select-all' + when tid = 'GTK_STOCK_SELECT_COLOR' then return 'gtk-select-color' + when tid = 'GTK_STOCK_SELECT_FONT' then return 'gtk-select-font' + when tid = 'GTK_STOCK_SORT_ASCENDING' then return 'gtk-sort-ascending' + when tid = 'GTK_STOCK_SORT_DESCENDING' then return 'gtk-sort-descending' + when tid = 'GTK_STOCK_SPELL_CHECK' then return 'gtk-spell-check' + when tid = 'GTK_STOCK_STOP' then return 'gtk-stop' + when tid = 'GTK_STOCK_STRIKETHROUGH' then return 'gtk-strikethrough' + when tid = 'GTK_STOCK_UNDELETE' then return 'gtk-undelete' + when tid = 'GTK_STOCK_UNDERLINE' then return 'gtk-underline' + when tid = 'GTK_STOCK_UNDO' then return 'gtk-undo' + when tid = 'GTK_STOCK_UNINDENT' then return 'gtk-unindent' + when tid = 'GTK_STOCK_YES' then return 'gtk-yes' + when tid = 'GTK_STOCK_ZOOM_100' then return 'gtk-zoom-100' + when tid = 'GTK_STOCK_ZOOM_FIT' then return 'gtk-zoom-fit' + when tid = 'GTK_STOCK_ZOOM_IN' then return 'gtk-zoom-in' + when tid = 'GTK_STOCK_ZOOM_OUT' then return 'gtk-zoom-out' -- GtkFileCoooserAction - when id = 'GTK_FILE_CHOOSER_ACTION_OPEN' then return 0 - when id = 'GTK_FILE_CHOOSER_ACTION_SAVE' then return 1 - when id = 'GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER' then return 2 - when id = 'GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER' then return 3 + when tid = 'GTK_FILE_CHOOSER_ACTION_OPEN' then return 0 + when tid = 'GTK_FILE_CHOOSER_ACTION_SAVE' then return 1 + when tid = 'GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER' then return 2 + when tid = 'GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER' then return 3 -- GtkAssistancePageType - when id = 'GTK_ASSISTANT_PAGE_CONTENT' then return 0 - when id = 'GTK_ASSISTANT_PAGE_INTRO' then return 1 - when id = 'GTK_ASSISTANT_PAGE_CONFIRM' then return 2 - when id = 'GTK_ASSISTANT_PAGE_SUMMARY' then return 3 - when id = 'GTK_ASSISTANT_PAGE_PROGRESS' then return 4 + when tid = 'GTK_ASSISTANT_PAGE_CONTENT' then return 0 + when tid = 'GTK_ASSISTANT_PAGE_INTRO' then return 1 + when tid = 'GTK_ASSISTANT_PAGE_CONFIRM' then return 2 + when tid = 'GTK_ASSISTANT_PAGE_SUMMARY' then return 3 + when tid = 'GTK_ASSISTANT_PAGE_PROGRESS' then return 4 -- GtkReliefType - when id = 'GTK_RELIEF_NORMAL' then return 0 - when id = 'GTK_RELIEF_HALF' then return 1 - when id = 'GTK_RELIEF_NONO' then return 2 + when tid = 'GTK_RELIEF_NORMAL' then return 0 + when tid = 'GTK_RELIEF_HALF' then return 1 + when tid = 'GTK_RELIEF_NONO' then return 2 -- GtkAtom - when id = 'GTK_SELECTION_PRIMARY' then return 1 - when id = 'GTK_SELECTION_SECONDARY' then return 2 - when id = 'GTK_SELECTION_CLIPBOARD' then return 69 + when tid = 'GTK_SELECTION_PRIMARY' then return 1 + when tid = 'GTK_SELECTION_SECONDARY' then return 2 + when tid = 'GTK_SELECTION_CLIPBOARD' then return 69 -- GtkShadow - when id = 'GTK_SHADOW_NONE' then return 0 - when id = 'GTK_SHADOW_IN' then return 1 - when id = 'GTK_SHADOW_OUT' then return 2 - when id = 'GTK_SHADOW_ETCHED_IN' then return 3 - when id = 'GTK_SHADOW_ETCHED_OUT' then return 4 + when tid = 'GTK_SHADOW_NONE' then return 0 + when tid = 'GTK_SHADOW_IN' then return 1 + when tid = 'GTK_SHADOW_OUT' then return 2 + when tid = 'GTK_SHADOW_ETCHED_IN' then return 3 + when tid = 'GTK_SHADOW_ETCHED_OUT' then return 4 -- GtkPositionType - when id = 'GTK_POS_LEFT' then return 0 - when id = 'GTK_POS_RIGHT' then return 1 - when id = 'GTK_POS_TOP' then return 2 - when id = 'GTK_POS_BOTTOM' then return 3 + when tid = 'GTK_POS_LEFT' then return 0 + when tid = 'GTK_POS_RIGHT' then return 1 + when tid = 'GTK_POS_TOP' then return 2 + when tid = 'GTK_POS_BOTTOM' then return 3 -- GtkIconSize - when id = 'GTK_ICON_SIZE_INVALID' then return 0 - when id = 'GTK_ICON_SIZE_MENU' then return 1 - when id = 'GTK_ICON_SIZE_SMALL_TOOLBAR' then return 2 - when id = 'GTK_ICON_SIZE_LARGE_TOOLBAR' then return 3 - when id = 'GTK_ICON_SIZE_BUTTON' then return 4 - when id = 'GTK_ICON_SIZE_DND' then return 5 - when id = 'GTK_ICON_SIZE_DIALOG' then return 6 + when tid = 'GTK_ICON_SIZE_INVALID' then return 0 + when tid = 'GTK_ICON_SIZE_MENU' then return 1 + when tid = 'GTK_ICON_SIZE_SMALL_TOOLBAR' then return 2 + when tid = 'GTK_ICON_SIZE_LARGE_TOOLBAR' then return 3 + when tid = 'GTK_ICON_SIZE_BUTTON' then return 4 + when tid = 'GTK_ICON_SIZE_DND' then return 5 + when tid = 'GTK_ICON_SIZE_DIALOG' then return 6 -- GtkJustification - when id = 'GTK_JUSTIFY_LEFT' then return 0 - when id = 'GTK_JUSTIFY_RIGHT' then return 1 - when id = 'GTK_JUSTIFY_CENTER' then return 2 - when id = 'GTK_JUSTIFY_FILL' then return 3 + when tid = 'GTK_JUSTIFY_LEFT' then return 0 + when tid = 'GTK_JUSTIFY_RIGHT' then return 1 + when tid = 'GTK_JUSTIFY_CENTER' then return 2 + when tid = 'GTK_JUSTIFY_FILL' then return 3 -- GtkPolicyType - when id = 'GTK_POLICY_ALWAYS' then return 0 - when id = 'GTK_POLICY_AUTOMATIC' then return 1 - when id = 'GTK_POLICY_NEVER' then return 2 + when tid = 'GTK_POLICY_ALWAYS' then return 0 + when tid = 'GTK_POLICY_AUTOMATIC' then return 1 + when tid = 'GTK_POLICY_NEVER' then return 2 -- GtkAttachOptions - when id = 'GTK_EXPAND' then return 2**0 - when id = 'GTK_SHRINK' then return 2**1 - when id = 'GTK_FILL' then return 2**2 + when tid = 'GTK_EXPAND' then return 2**0 + when tid = 'GTK_SHRINK' then return 2**1 + when tid = 'GTK_FILL' then return 2**2 -- GtkWrapMode - when id = 'GTK_WRAP_NONE' then return 0 - when id = 'GTK_WRAP_CHAR' then return 1 - when id = 'GTK_WRAP_WORD' then return 2 - when id = 'GTK_WRAP_WORD_CHAR' then return 3 + when tid = 'GTK_WRAP_NONE' then return 0 + when tid = 'GTK_WRAP_CHAR' then return 1 + when tid = 'GTK_WRAP_WORD' then return 2 + when tid = 'GTK_WRAP_WORD_CHAR' then return 3 -- GtkStateType - when id = 'GTK_STATE_NORMAL' then return 0 - when id = 'GTK_STATE_ACTIVE' then return 1 - when id = 'GTK_STATE_PRELIGHT' then return 2 - when id = 'GTK_STATE_SELECTED' then return 3 - when id = 'GTK_STATE_INSENSITIVE' then return 4 + when tid = 'GTK_STATE_NORMAL' then return 0 + when tid = 'GTK_STATE_ACTIVE' then return 1 + when tid = 'GTK_STATE_PRELIGHT' then return 2 + when tid = 'GTK_STATE_SELECTED' then return 3 + when tid = 'GTK_STATE_INSENSITIVE' then return 4 -- Pango scale factors - when id = 'PANGO_SCALE_XX_SMALL' then return 0.5787037037037 - when id = 'PANGO_SCALE_X_SMALL' then return 0.6444444444444 - when id = 'PANGO_SCALE_SMALL' then return 0.8333333333333 - when id = 'PANGO_SCALE_MEDIUM' then return 1.0 - when id = 'PANGO_SCALE_LARGE' then return 1.2 - when id = 'PANGO_SCALE_X_LARGE' then return 1.4399999999999 - when id = 'PANGO_SCALE_XX_LARGE' then return 1.728 + when tid = 'PANGO_SCALE_XX_SMALL' then return 0.5787037037037 + when tid = 'PANGO_SCALE_X_SMALL' then return 0.6444444444444 + when tid = 'PANGO_SCALE_SMALL' then return 0.8333333333333 + when tid = 'PANGO_SCALE_MEDIUM' then return 1.0 + when tid = 'PANGO_SCALE_LARGE' then return 1.2 + when tid = 'PANGO_SCALE_X_LARGE' then return 1.4399999999999 + when tid = 'PANGO_SCALE_XX_LARGE' then return 1.728 -- PangoWeight - when id = 'PANGO_WEIGHT_ULTRALIGHT' then return 200 - when id = 'PANGO_WEIGHT_LIGHT' then return 300 - when id = 'PANGO_WEIGHT_NORMAL' then return 400 - when id = 'PANGO_WEIGHT_SEMIBOLD' then return 600 - when id = 'PANGO_WEIGHT_BOLD' then return 700 - when id = 'PANGO_WEIGHT_ULTRABOLD' then return 800 - when id = 'PANGO_WEIGHT_HEAVY' then return 900 + when tid = 'PANGO_WEIGHT_ULTRALIGHT' then return 200 + when tid = 'PANGO_WEIGHT_LIGHT' then return 300 + when tid = 'PANGO_WEIGHT_NORMAL' then return 400 + when tid = 'PANGO_WEIGHT_SEMIBOLD' then return 600 + when tid = 'PANGO_WEIGHT_BOLD' then return 700 + when tid = 'PANGO_WEIGHT_ULTRABOLD' then return 800 + when tid = 'PANGO_WEIGHT_HEAVY' then return 900 -- PangoStyle - when id = 'PANGO_STYLE_NORMAL' then return 0 - when id = 'PANGO_STYLE_OBLIQUE' then return 1 - when id = 'PANGO_STYLE_ITALIC' then return 2 + when tid = 'PANGO_STYLE_NORMAL' then return 0 + when tid = 'PANGO_STYLE_OBLIQUE' then return 1 + when tid = 'PANGO_STYLE_ITALIC' then return 2 -- PangoUnderline - when id = 'PANGO_UNDERLINE_NONE' then return 0 - when id = 'PANGO_UNDERLINE_SINGLE' then return 1 - when id = 'PANGO_UNDERLINE_DOUBLE' then return 2 - when id = 'PANGO_UNDERLINE_LOW' then return 3 - when id = 'PANGO_UNDERLINE_ERROR' then return 4 + when tid = 'PANGO_UNDERLINE_NONE' then return 0 + when tid = 'PANGO_UNDERLINE_SINGLE' then return 1 + when tid = 'PANGO_UNDERLINE_DOUBLE' then return 2 + when tid = 'PANGO_UNDERLINE_LOW' then return 3 + when tid = 'PANGO_UNDERLINE_ERROR' then return 4 -- Just return the id otherwise nop end @@ -2801,7 +2801,8 @@ ::method init self~init:super() -use strict arg self~set_from_file +use strict arg filename +self~set_from_file(filename) return @@ -2814,7 +2815,7 @@ ::method init self~init:super() use strict arg stockid, size -self~set_from_stock(GTK_Constant(stockid), size) +self~set_from_stock(stockid, size) return @@ -2822,7 +2823,7 @@ /* Class: GtkImage_From_Icon_Name */ /*============================================================================*/ -::class GtkImageFromIconName public subclass GtkImage +::class GtkImage_From_Icon_Name public subclass GtkImage ::method init self~init:super() @@ -3124,6 +3125,12 @@ call GrxTextBufferRemoveAllTags pointer return +::method insert_image +expose pointer +use strict arg img, linenum +call GrxTextBufferInsertImage pointer, img~pointer, linenum +return + ::method signal_connect use strict arg event select Added: sandbox/david/test7-8.rex =================================================================== --- sandbox/david/test7-8.rex (rev 0) +++ sandbox/david/test7-8.rex 2008-03-18 14:11:05 UTC (rev 2402) @@ -0,0 +1,76 @@ +#!/usr/bin/rexx +/*----------------------------------------------------------------------------*/ +/* */ +/* Copyright (c) 2007-2008 Rexx Language Association. All rights reserved. */ +/* */ +/* This program and the accompanying materials are made available under */ +/* the terms of the Common Public License v1.0 which accompanies this */ +/* distribution. A copy is also available at the following address: */ +/* http://www.oorexx.org/license.html */ +/* */ +/* Redistribution and use in source and binary forms, with or */ +/* without modification, are permitted provided that the following */ +/* conditions are met: */ +/* */ +/* Redistributions of source code must retain the above copyright */ +/* notice, this list of conditions and the following disclaimer. */ +/* Redistributions in binary form must reproduce the above copyright */ +/* notice, this list of conditions and the following disclaimer in */ +/* the documentation and/or other materials provided with the distribution. */ +/* */ +/* Neither the name of Rexx Language Association nor the names */ +/* of its contributors may be used to endorse or promote products */ +/* derived from this software without specific prior written permission. */ +/* */ +/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ +/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ +/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */ +/* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ +/* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ +/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */ +/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ +/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */ +/* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ +/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */ +/* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* */ +/* Authors; */ +/* W. David Ashley <da...@us...> */ +/* */ +/*----------------------------------------------------------------------------*/ + + +-- Derived from Listing 7-8 +-- Foundations of GTK+ Development +-- by Andrew Krause + +window = .myMainWindow~new('GTK_WINDOW_TOPLEVEL') +window~set_title('Pixbufs') +window~signal_connect('destroy') +window~set_border_width(10) +window~set_size_request(250, 150) + +textview = .GtkTextview~new() +buffer = textview~get_buffer() +buffer~set_text(" ooRexx" || '0A'x) + +image = .GtkImage_From_File~new('oorexx.jpg') +buffer~insert_image(image, 0) + +scrolled_win = .GtkScrolledWindow~new(.nil, .nil) +scrolled_win~add(textview) +window~add(scrolled_win) +window~show_all() + +call gtk_main +return + + +::requires 'rexxgtk.cls' + +::class myMainWindow subclass GtkWindow + +::method signal_destroy +call gtk_main_quit +return + Property changes on: sandbox/david/test7-8.rex ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native Added: sandbox/david/test7-8a.rex =================================================================== --- sandbox/david/test7-8a.rex (rev 0) +++ sandbox/david/test7-8a.rex 2008-03-18 14:11:05 UTC (rev 2402) @@ -0,0 +1,76 @@ +#!/usr/bin/rexx +/*----------------------------------------------------------------------------*/ +/* */ +/* Copyright (c) 2007-2008 Rexx Language Association. All rights reserved. */ +/* */ +/* This program and the accompanying materials are made available under */ +/* the terms of the Common Public License v1.0 which accompanies this */ +/* distribution. A copy is also available at the following address: */ +/* http://www.oorexx.org/license.html */ +/* */ +/* Redistribution and use in source and binary forms, with or */ +/* without modification, are permitted provided that the following */ +/* conditions are met: */ +/* */ +/* Redistributions of source code must retain the above copyright */ +/* notice, this list of conditions and the following disclaimer. */ +/* Redistributions in binary form must reproduce the above copyright */ +/* notice, this list of conditions and the following disclaimer in */ +/* the documentation and/or other materials provided with the distribution. */ +/* */ +/* Neither the name of Rexx Language Association nor the names */ +/* of its contributors may be used to endorse or promote products */ +/* derived from this software without specific prior written permission. */ +/* */ +/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ +/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ +/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */ +/* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ +/* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ +/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */ +/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ +/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */ +/* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ +/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */ +/* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* */ +/* Authors; */ +/* W. David Ashley <da...@us...> */ +/* */ +/*----------------------------------------------------------------------------*/ + + +-- Derived from Listing 7-8 +-- Foundations of GTK+ Development +-- by Andrew Krause + +window = .myMainWindow~new('GTK_WINDOW_TOPLEVEL') +window~title = 'Pixbufs' +window~signal_connect('destroy') +window~set_border_width(10) +window~set_size_request(250, 150) + +textview = .GtkTextview~new() +buffer = textview~get_buffer() +buffer~set_text(" ooRexx" || '0A'x) + +image = .GtkImage_From_File~new('oorexx.jpg') +buffer~insert_image(image, 0) + +scrolled_win = .GtkScrolledWindow~new(.nil, .nil) +scrolled_win~add(textview) +window~add(scrolled_win) +window~show_all() + +call gtk_main +return + + +::requires 'rexxgtk.cls' + +::class myMainWindow subclass GtkWindow + +::method signal_destroy +call gtk_main_quit +return + Property changes on: sandbox/david/test7-8a.rex ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |