listeners.c File Reference

Implementation of the listener functions. More...

#include "listeners.h"

Include dependency graph for listeners.c:

Go to the source code of this file.

Defines

#define CLS_CBACTIONLISTENER   "at/fhv/sgr/guilib/listeners/CBActionListener"
 Defines the full name of the CBActionListener-Class.
#define CLS_CBCOMPONENTLISTENER   "at/fhv/sgr/guilib/listeners/CBComponentListener"
 Defines the full name of the CBComponentListener-Class.
#define CLS_CBITEMLISTENER   "at/fhv/sgr/guilib/listeners/CBItemListener"
 Defines the full name of the CBItemListener-Class.
#define CLS_CBMOUSELISTENER   "at/fhv/sgr/guilib/listeners/CBMouseListener"
 Defines the full name of the CBMouseListener-Class.
#define CLS_CBWINDOWLISTENER   "at/fhv/sgr/guilib/listeners/CBWindowListener"
 Defines the full name of the CBWindowListener-Class.

Functions

ActionListener addActionListener (jobject obj, void(*func)(Component))
 Adds an ActionListener for a Component to call back the specified function.
ComponentListener addComponentListener (jobject obj, void(*func)(jint, Component))
 Adds a ComponentListener for a Component to call back the specified function.
ItemListener addItemListener (jobject obj, void(*func)(Component, jboolean, const char *))
 Adds a ItemListener for a Component to call back the specified function.
MouseListener addMouseListener (jobject obj, void(*func)(jint, Component, jint, jint, jint, jint))
 Adds a MouseListener for a Component to call back the specified function.
WindowListener addWindowListener (jobject obj, void(*func)(jint, Window))
 Adds a WindowListener for a Window to call back the specified function.
void cbActionListener (JNIEnv *env, jobject jobj, jlong ptr, jobject source)
 ActionListener callback function.
void cbComponentListener (JNIEnv *env, jobject jobj, jlong ptr, jint event, jobject source)
 ComponentListener callback function.
void cbItemListener (JNIEnv *env, jobject jobj, jlong ptr, jobject source, jboolean selected, jobject item)
 ItemListener callback function.
void cbMouseListener (JNIEnv *env, jobject jobj, jlong ptr, jint event, jobject window, jint x, jint y, jint button, jint clickCount)
 MouseListener callback function.
void cbWindowListener (JNIEnv *env, jobject jobj, jlong ptr, jint event, jobject window)
 WindowListener callback function.
void removeActionListener (jobject obj, ActionListener al)
 Removes an ActionListener from a Component and deletes the global reference to the ActionListener.
void removeComponentListener (jobject obj, ComponentListener cl)
 Removes a ComponentListener from a Component and deletes the global reference to the ComponentListener.
void removeItemListener (jobject obj, ItemListener il)
 Removes a ItemListener from a Component and deletes the global reference to the MouseListener.
void removeMouseListener (jobject obj, MouseListener ml)
 Removes a MouseListener from a Component and deletes the global reference to the MouseListener.
void removeWindowListener (jobject obj, WindowListener wl)
 Removes a WindowListener from a Window and deletes the global reference to the WindowListener.


Detailed Description

Implementation of the listener functions.

In Java Listeners are objects which want to get informed about specific events. In this library callback functions where used to get informed about events. These functions allow to register the callback functions as listeners. The callback functions must have a certain signature depending on the event(s) you want to get informed about.

Author:
Stefan Gruber
Date:
01.02.2005

Definition in file listeners.c.


Define Documentation

#define CLS_CBACTIONLISTENER   "at/fhv/sgr/guilib/listeners/CBActionListener"
 

Defines the full name of the CBActionListener-Class.

Definition at line 31 of file listeners.c.

#define CLS_CBCOMPONENTLISTENER   "at/fhv/sgr/guilib/listeners/CBComponentListener"
 

Defines the full name of the CBComponentListener-Class.

Definition at line 28 of file listeners.c.

#define CLS_CBITEMLISTENER   "at/fhv/sgr/guilib/listeners/CBItemListener"
 

Defines the full name of the CBItemListener-Class.

Definition at line 34 of file listeners.c.

#define CLS_CBMOUSELISTENER   "at/fhv/sgr/guilib/listeners/CBMouseListener"
 

Defines the full name of the CBMouseListener-Class.

Definition at line 25 of file listeners.c.

#define CLS_CBWINDOWLISTENER   "at/fhv/sgr/guilib/listeners/CBWindowListener"
 

Defines the full name of the CBWindowListener-Class.

Definition at line 22 of file listeners.c.


Function Documentation

ActionListener addActionListener jobject  obj,
void(*)(Component func
 

Adds an ActionListener for a Component to call back the specified function.

The parameters of the function pointer are:

  1. The component which caused the call.

Parameters:
obj - The Component to add the listener to.
func - The function to call back.
Returns:
the created ActionListener object.
See also:
removeActionListener(jobject obj, ActionListener al)

Definition at line 285 of file listeners.c.

ComponentListener addComponentListener jobject  obj,
void(*)(jint, Component func
 

Adds a ComponentListener for a Component to call back the specified function.

The parameters of the function pointer are:

  1. The event which caused the call (see defines starting with "CB_COMPONENT_").
  2. The component which caused the call.

Parameters:
obj - The Component to add the listener to.
func - The function to call back.
Returns:
the created ComponentListener object.
See also:
removeComponentListener(jobject obj, ComponentListener cl)

Definition at line 137 of file listeners.c.

ItemListener addItemListener jobject  obj,
void(*)(Component, jboolean, const char *)  func
 

Adds a ItemListener for a Component to call back the specified function.

The parameters of the function pointer are:

  1. The component which caused the call.
  2. The state of the item (selected or not).
  3. The item.

Parameters:
obj - The Component to add the listener to.
func - The function to call back.
Returns:
the created MouseListener object.
See also:
removeItemListener(jobject obj, ItemListener il)

Definition at line 359 of file listeners.c.

MouseListener addMouseListener jobject  obj,
void(*)(jint, Component, jint, jint, jint, jint)  func
 

Adds a MouseListener for a Component to call back the specified function.

The parameters of the function pointer are:

  1. The event which caused the call (see defines starting with "CB_MOUSE_").
  2. The component which caused the call.
  3. The X-Pos of the event.
  4. The Y-Pos of the event.
  5. The pressed mouse button.
  6. The number of times the user clicked.

Parameters:
obj - The Component to add the listener to.
func - The function to call back.
Returns:
the created MouseListener object.
See also:
removeMouseListener(jobject obj, MouseListener ml)

Definition at line 216 of file listeners.c.

WindowListener addWindowListener jobject  obj,
void(*)(jint, Window func
 

Adds a WindowListener for a Window to call back the specified function.

The parameters of the function pointer are:

  1. The event which caused the call (see defines starting with "CB_WINDOW_").
  2. The window which caused the call.

Parameters:
obj - The Window to add the listener to.
func - The function to call back.
Returns:
the created WindowListener object.
See also:
removeWindowListener(jobject obj, WindowListener wl)

Definition at line 66 of file listeners.c.

void cbActionListener JNIEnv *  env,
jobject  jobj,
jlong  ptr,
jobject  source
 

ActionListener callback function.

Called from a Java CBActionListener Object. The function calls the function of the pointer.

Parameters:
env - Pointer to the current JNIEnv.
jobj - The object on which the function was invoked.
ptr - The address of the function to invoke.
source - The source which caused the call.

Definition at line 266 of file listeners.c.

void cbComponentListener JNIEnv *  env,
jobject  jobj,
jlong  ptr,
jint  event,
jobject  source
 

ComponentListener callback function.

Called from a Java CBComponentListener Object. The function calls the function of the pointer.

Parameters:
env - Pointer to the current JNIEnv.
jobj - The object on which the function was invoked.
ptr - The address of the function to invoke.
event - The event which caused the call.
source - The source which caused the call.

Definition at line 117 of file listeners.c.

void cbItemListener JNIEnv *  env,
jobject  jobj,
jlong  ptr,
jobject  source,
jboolean  selected,
jobject  item
 

ItemListener callback function.

Called from a Java CBMouseListener Object. The function calls the function of the pointer.

Parameters:
env - Pointer to the current JNIEnv.
jobj - The object on which the function was invoked.
ptr - The address of the function to invoke.
source - The source which caused the call.
selected - If the item is selected or not.
item - The item.

Definition at line 337 of file listeners.c.

void cbMouseListener JNIEnv *  env,
jobject  jobj,
jlong  ptr,
jint  event,
jobject  window,
jint  x,
jint  y,
jint  button,
jint  clickCount
 

MouseListener callback function.

Called from a Java CBMouseListener Object. The function calls the function of the pointer.

Parameters:
env - Pointer to the current JNIEnv.
jobj - The object on which the function was invoked.
ptr - The address of the function to invoke.
event - The event which caused the call.
window - The window which caused the call.
x - The X-Pos of the event.
y - The Y-Pos of the event.
button - The pressed button.
clickCount - The number of times the user clicked.

Definition at line 192 of file listeners.c.

void cbWindowListener JNIEnv *  env,
jobject  jobj,
jlong  ptr,
jint  event,
jobject  window
 

WindowListener callback function.

Called from a Java CBWindowListener Object. The function calls the function of the pointer.

Parameters:
env - Pointer to the current JNIEnv.
jobj - The object on which the function was invoked.
ptr - The address of the function to invoke.
event - The event which caused the call.
window - The window which caused the call.

Definition at line 46 of file listeners.c.

void removeActionListener jobject  obj,
ActionListener  al
 

Removes an ActionListener from a Component and deletes the global reference to the ActionListener.

Parameters:
obj - The Component to remove the listener from.
al - The ActionListener to remove.
See also:
addActionListener(jobject obj, void (*func)(Component))

Definition at line 318 of file listeners.c.

void removeComponentListener jobject  obj,
ComponentListener  cl
 

Removes a ComponentListener from a Component and deletes the global reference to the ComponentListener.

Parameters:
obj - The Component to remove the listener from.
cl - The ComponentListener to remove.
See also:
addComponentListener(jobject obj, void (*func)(jint, Component))

Definition at line 170 of file listeners.c.

void removeItemListener jobject  obj,
ItemListener  il
 

Removes a ItemListener from a Component and deletes the global reference to the MouseListener.

Parameters:
obj - The Component to remove the listener from.
il - The MouseListener to remove.
See also:
addItemListener(jobject obj, void (*func)(Component, jboolean, const char*))

Definition at line 392 of file listeners.c.

void removeMouseListener jobject  obj,
MouseListener  ml
 

Removes a MouseListener from a Component and deletes the global reference to the MouseListener.

Parameters:
obj - The Component to remove the listener from.
ml - The MouseListener to remove.
See also:
addMouseListener(jobject obj, void (*func)(jint, Component, jint, jint, jint, jint))

Definition at line 249 of file listeners.c.

void removeWindowListener jobject  obj,
WindowListener  wl
 

Removes a WindowListener from a Window and deletes the global reference to the WindowListener.

Parameters:
obj - The Window to remove the listener from.
wl - The WindowListener to remove.
See also:
addWindowListener(jobject obj, void (*func)(jint, Window))

Definition at line 99 of file listeners.c.


Generated on Sat Nov 19 14:11:14 2005 for GrubC by  doxygen 1.4.4