org.gnu.glib
Class GObject

java.lang.Object
  |
  +--org.gnu.glib.GObject
Direct Known Subclasses:
AccelGroup, AtkObject, AttrList, CellRenderer, Colormap, Context, CustomEvents, Device, DragContext, Drawable, Event, Font, FontFace, FontFamily, GC, Geometry, GListString, GtkObject, IconFactory, Image, IMContext, Keymap, Layout, PangoAttrEmbossed, PangoAttrStipple, Pixbuf, PixbufLoader, RcStyle, Region, Relation, RelationSet, SelectionData, Settings, SizeGroup, Style, TargetEntry, TextBuffer, TextChildAnchor, TextMark, TextTag, TextTagTable, Timer, TreeModel, TreeModelSort, TreeSelection, TreeSortable, TreeViewColumn, TypeInterface, Visual, WindowAttr, WindowGroup

public class GObject
extends java.lang.Object

Base class for all objects that participate in the GLib object system.


Constructor Summary
GObject(int handle)
          Create a new GObject with a handle to a native resource returned from a call to the native libraries.
 
Method Summary
 int addEventHandler(java.lang.String name, java.lang.Object cbrecv)
          Connect an event to a callback method that has the same name as the event.
 int addEventHandler(java.lang.String name, java.lang.Object cbrecv, java.lang.Object data)
          Connect a event to a callback method that has the same name as the event.
 int addEventHandler(java.lang.String name, java.lang.String func, java.lang.Class cbrecv)
          Connect a event to a static callback method "func" in Class "cbrecv".
 int addEventHandler(java.lang.String name, java.lang.String func, java.lang.Class cbrecv, java.lang.Object data)
          Connect a event to a static callback method "func" in Class "cbrecv".
 int addEventHandler(java.lang.String name, java.lang.String func, java.lang.Object cbrecv)
          Connect a event to a callback method "func" in object "cbrecv".
 int addEventHandler(java.lang.String name, java.lang.String func, java.lang.Object cbrecv, java.lang.Object data)
          Connect a event to a callback method "func" in object "cbrecv".
 boolean equals(java.lang.Object other)
           
 java.lang.Object getData(java.lang.String key)
           
 int getHandle()
          Get the raw handle value.
 void removeEventHandler(int handler)
          Disconnect a event from its' callback method.
 void setData(java.lang.String key, java.lang.Object data)
           
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GObject

public GObject(int handle)
Create a new GObject with a handle to a native resource returned from a call to the native libraries.

Parameters:
handle - The handle that represents a pointer to a native resource.
Method Detail

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

getHandle

public final int getHandle()
Get the raw handle value. This value should never be modified by the application. It's sole use is to pass to native methods.

Returns:
the handle value.

addEventHandler

public int addEventHandler(java.lang.String name,
                           java.lang.Object cbrecv)
Connect an event to a callback method that has the same name as the event. For example, the event "clicked" will be mapped to a method "clicked()" in the object cbrecv.

Parameters:
name - The name of the event to map.
Returns:
The handle id of the event that can be used in a call to removeEventHandler.

addEventHandler

public int addEventHandler(java.lang.String name,
                           java.lang.Object cbrecv,
                           java.lang.Object data)
Connect a event to a callback method that has the same name as the event. For example, the event "clicked" will be mapped to a method "clicked()" in the object cbrecv.

Parameters:
name - The name of the event to map.
data - User defined data that will be passed to the callback.
Returns:
The handle id of the event that can be used in a call to removeEventHandler.

addEventHandler

public int addEventHandler(java.lang.String name,
                           java.lang.String func,
                           java.lang.Object cbrecv)
Connect a event to a callback method "func" in object "cbrecv".

Parameters:
name - The name of the event to map.
func - The name of the callback method.
Returns:
The handle id of the event that can be used in a call to removeEventHandler.

addEventHandler

public int addEventHandler(java.lang.String name,
                           java.lang.String func,
                           java.lang.Object cbrecv,
                           java.lang.Object data)
Connect a event to a callback method "func" in object "cbrecv".

Parameters:
name - The name of the event to map.
func - The name of the callback method.
data - User defined data that will be passed to the callback.
Returns:
The handle id of the event that can be used in a call to removeEventHandler.

addEventHandler

public int addEventHandler(java.lang.String name,
                           java.lang.String func,
                           java.lang.Class cbrecv)
Connect a event to a static callback method "func" in Class "cbrecv".

Parameters:
name - The name of the event to map.
func - The name of the static callback method.
Returns:
The handle id of the event that can be used in a call to removeEventHandler.

addEventHandler

public int addEventHandler(java.lang.String name,
                           java.lang.String func,
                           java.lang.Class cbrecv,
                           java.lang.Object data)
Connect a event to a static callback method "func" in Class "cbrecv".

Parameters:
name - The name of the event to map.
func - The name of the static callback method.
data - User defined data that will be passed to the callback.
Returns:
The handle id of the event that can be used in a call to removeEventHandler.

removeEventHandler

public void removeEventHandler(int handler)
Disconnect a event from its' callback method.


getData

public java.lang.Object getData(java.lang.String key)

setData

public void setData(java.lang.String key,
                    java.lang.Object data)

Please send any bug reports, comments, or suggestions for the API or documentation to java-gnome-developer@lists.sf.net