From: <wda...@us...> - 2008-01-14 15:48:52
|
Revision: 2206 http://oorexx.svn.sourceforge.net/oorexx/?rev=2206&view=rev Author: wdashley Date: 2008-01-14 07:48:55 -0800 (Mon, 14 Jan 2008) Log Message: ----------- ArtifactID: None Comment: Added the GtkEventBox class. Note that this class is useless in rexxgtk since we do not support event callbacks. Modified Paths: -------------- sandbox/david/Makefile sandbox/david/Makefile.win sandbox/david/rexxgtk.c sandbox/david/rexxgtk.cls Added Paths: ----------- sandbox/david/grxeventbox.c sandbox/david/test3-9.rex Modified: sandbox/david/Makefile =================================================================== --- sandbox/david/Makefile 2008-01-14 14:22:57 UTC (rev 2205) +++ sandbox/david/Makefile 2008-01-14 15:48:55 UTC (rev 2206) @@ -57,7 +57,8 @@ grxfixed.o \ grxexpander.o \ grxhandlebox.o \ - grxnotebook.o + grxnotebook.o \ + grxeventbox.o # Build the shared library @@ -108,8 +109,11 @@ grxnotebook.o: grxnotebook.c rexxgtk.h gcc -c $(GRXCFLAGS) grxnotebook.c +grxeventbox.o: grxeventbox.c rexxgtk.h + gcc -c $(GRXCFLAGS) grxeventbox.c + clean: rm *.so *.o Modified: sandbox/david/Makefile.win =================================================================== --- sandbox/david/Makefile.win 2008-01-14 14:22:57 UTC (rev 2205) +++ sandbox/david/Makefile.win 2008-01-14 15:48:55 UTC (rev 2206) @@ -70,7 +70,8 @@ grxfixed.obj \ grxexpander.obj \ grxhandlebox.obj \ - grxnotebook.obj + grxnotebook.obj \ + grxeventbox.obj # Build the DLL @@ -122,8 +123,11 @@ grxnotebook.obj: grxnotebook.c rexxgtk.h cl -c $(GRXCFLAGS) grxnotebook.c +grxeventbox.obj: grxeventbox.c rexxgtk.h + cl -c $(GRXCFLAGS) grxeventbox.c + clean: rm *.so *.o Added: sandbox/david/grxeventbox.c =================================================================== --- sandbox/david/grxeventbox.c (rev 0) +++ sandbox/david/grxeventbox.c 2008-01-14 15:48:55 UTC (rev 2206) @@ -0,0 +1,227 @@ +/*----------------------------------------------------------------------------*/ +/* */ +/* 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...> */ +/* */ +/*----------------------------------------------------------------------------*/ + + +/* include the linux headers and our local stuff */ +#include "rexxgtk.h" + + +/*----------------------------------------------------------------------------*/ +/* Global variables */ +/*----------------------------------------------------------------------------*/ + + +/*----------------------------------------------------------------------------*/ +/* Local Definitions */ +/*----------------------------------------------------------------------------*/ + + +/*============================================================================*/ +/* Private Functions */ +/*============================================================================*/ + + +/*============================================================================*/ +/* Public Functions */ +/*============================================================================*/ + + +/*----------------------------------------------------------------------------*/ +/* Rexx External Function: GrxEventBoxNew */ +/* Description: Create a eventbox. */ +/* Rexx Args: Label */ +/*----------------------------------------------------------------------------*/ + +APIRET APIENTRY GrxEventBoxNew(const char * Name, + const size_t Argc, const RXSTRING Argv[], + const char * Queuename, PRXSTRING Retstr) +{ + GtkWidget *myWidget; + + /* Check for valid arguments */ + if (GrxCheckArgs(0, Argc, Argv)) { + return RXFUNC_BADCALL; + } + + myWidget = gtk_event_box_new(); + + /* Set up the REXX return code */ + sprintf(Retstr->strptr, "%p", myWidget); + Retstr->strlength = strlen(Retstr->strptr); + + return RXFUNC_OK; +} + + +/*----------------------------------------------------------------------------*/ +/* Rexx External Function: GrxEventBoxSetAboveChild */ +/* Description: Set the z-order position with respect to a child. */ +/* Rexx Args: Pointer to the widget */ +/* Flag */ +/*----------------------------------------------------------------------------*/ + +APIRET APIENTRY GrxEventBoxSetAboveChild(const char * Name, + const size_t Argc, const RXSTRING Argv[], + const char * Queuename, PRXSTRING Retstr) +{ + GtkWidget *myWidget; + gboolean flag; + + /* Check for valid arguments */ + if (GrxCheckArgs(2, Argc, Argv)) { + return RXFUNC_BADCALL; + } + + /* Initialize function parameters */ + sscanf(Argv[0].strptr, "%p", &myWidget); + sscanf(Argv[1].strptr, "%d", &flag); + + if (GTK_IS_WIDGET(GTK_OBJECT(myWidget))) { + gtk_event_box_set_above_child(GTK_EVENT_BOX(myWidget), flag); + } + + /* Set up the REXX return code */ + *(Retstr->strptr) = '0'; + Retstr->strlength = 1; + + return RXFUNC_OK; +} + + +/*----------------------------------------------------------------------------*/ +/* Rexx External Function: GrxEventBoxGetAboveChild */ +/* Description: Get the z-order position with respect to a child. */ +/* Rexx Args: Pointer to the widget */ +/*----------------------------------------------------------------------------*/ + +APIRET APIENTRY GrxEventBoxGetAboveChild(const char * Name, + const size_t Argc, const RXSTRING Argv[], + const char * Queuename, PRXSTRING Retstr) +{ + GtkWidget *myWidget; + gboolean flag; + + /* Check for valid arguments */ + if (GrxCheckArgs(1, Argc, Argv)) { + return RXFUNC_BADCALL; + } + + /* Initialize function parameters */ + sscanf(Argv[0].strptr, "%p", &myWidget); + + if (GTK_IS_WIDGET(GTK_OBJECT(myWidget))) { + flag = gtk_event_box_get_above_child(GTK_EVENT_BOX(myWidget)); + } + + /* Set up the REXX return code */ + sprintf(Retstr->strptr, "%d", flag); + Retstr->strlength = strlen(Retstr->strptr); + + return RXFUNC_OK; +} + + +/*----------------------------------------------------------------------------*/ +/* Rexx External Function: GrxEventBoxSetVisibleWindow */ +/* Description: Set the visibility of the window. */ +/* Rexx Args: Pointer to the widget */ +/* Flag */ +/*----------------------------------------------------------------------------*/ + +APIRET APIENTRY GrxEventBoxSetVisibleWindow(const char * Name, + const size_t Argc, const RXSTRING Argv[], + const char * Queuename, PRXSTRING Retstr) +{ + GtkWidget *myWidget; + gboolean flag; + + /* Check for valid arguments */ + if (GrxCheckArgs(2, Argc, Argv)) { + return RXFUNC_BADCALL; + } + + /* Initialize function parameters */ + sscanf(Argv[0].strptr, "%p", &myWidget); + sscanf(Argv[1].strptr, "%d", &flag); + + if (GTK_IS_WIDGET(GTK_OBJECT(myWidget))) { + gtk_event_box_set_visible_window(GTK_EVENT_BOX(myWidget), flag); + } + + /* Set up the REXX return code */ + *(Retstr->strptr) = '0'; + Retstr->strlength = 1; + + return RXFUNC_OK; +} + + +/*----------------------------------------------------------------------------*/ +/* Rexx External Function: GrxEventBoxGetVisibleWindow */ +/* Description: Get the visibility of the window. */ +/* Rexx Args: Pointer to the widget */ +/*----------------------------------------------------------------------------*/ + +APIRET APIENTRY GrxEventBoxGetVisibleWindow(const char * Name, + const size_t Argc, const RXSTRING Argv[], + const char * Queuename, PRXSTRING Retstr) +{ + GtkWidget *myWidget; + gboolean flag; + + /* Check for valid arguments */ + if (GrxCheckArgs(1, Argc, Argv)) { + return RXFUNC_BADCALL; + } + + /* Initialize function parameters */ + sscanf(Argv[0].strptr, "%p", &myWidget); + + if (GTK_IS_WIDGET(GTK_OBJECT(myWidget))) { + flag = gtk_event_box_get_visible_window(GTK_EVENT_BOX(myWidget)); + } + + /* Set up the REXX return code */ + sprintf(Retstr->strptr, "%d", flag); + Retstr->strlength = strlen(Retstr->strptr); + + return RXFUNC_OK; +} + Property changes on: sandbox/david/grxeventbox.c ___________________________________________________________________ Name: svn:eol-style + native Modified: sandbox/david/rexxgtk.c =================================================================== --- sandbox/david/rexxgtk.c 2008-01-14 14:22:57 UTC (rev 2205) +++ sandbox/david/rexxgtk.c 2008-01-14 15:48:55 UTC (rev 2206) @@ -293,6 +293,11 @@ "GrxHandleBoxSetHandlePosition", "GrxHandleBoxSetSnapEdge", "GrxHandleBoxConnectSignal", + "GrxEventBoxNew", + "GrxEventBoxSetAboveChild", + "GrxEventBoxGetAboveChild", + "GrxEventBoxSetVisibleWindow", + "GrxEventBoxGetVisibleWindow", }; Modified: sandbox/david/rexxgtk.cls =================================================================== --- sandbox/david/rexxgtk.cls 2008-01-14 14:22:57 UTC (rev 2205) +++ sandbox/david/rexxgtk.cls 2008-01-14 15:48:55 UTC (rev 2206) @@ -1234,3 +1234,49 @@ ::method signal_switch_page return + +/*============================================================================*/ +/* Class: EventBox */ +/*============================================================================*/ + +::class GtkEventBox public subclass GtkContainer + +::method init +use strict arg +self~pointer = GrxEventBoxNew() +return + +::method 'above_child=' +use strict arg flag +call GrxEventBoxSetAboveChild self~pointer, flag +return + +::method set_above_child +use strict arg self~shadow_type +return + +::method above_child +use strict arg +return GrxEventBoxGetAboveChild(self~pointer) + +::method get_above_child +use strict arg +return self~above_child + +::method 'visible_window=' +use strict arg flag +call GrxEventBoxSetVisibleWindow self~pointer, flag +return + +::method set_visible_window +use strict arg self~visible_window +return + +::method visible_window +use strict arg +return GrxEventBoxGetVisibleWindow(self~pointer) + +::method get_visible_window +use strict arg +return self~visible_window + Added: sandbox/david/test3-9.rex =================================================================== --- sandbox/david/test3-9.rex (rev 0) +++ sandbox/david/test3-9.rex 2008-01-14 15:48:55 UTC (rev 2206) @@ -0,0 +1,49 @@ +#!/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 3-9 +-- Foundations of GTK+ Development +-- by Andrew Krause + +-- Event callbacks are not supported in rexxgtk so this example is not +-- implementd. + Property changes on: sandbox/david/test3-9.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. |