#include <Widget.H>
|
| Widget () |
| Construcotr. More...
|
|
| Widget (GtkWidget *w) |
|
virtual | ~Widget () |
| Destructor. More...
|
|
GtkWidget * | ref (void) |
|
void | unref (void) |
|
GtkWidget * | show (void) |
|
GtkWidget * | hide (void) |
|
bool | getVisible (void) |
|
GtkWidget * | getWidget (void) |
|
bool | getSensitive (void) |
|
void | setSensitive (bool sens) |
|
void | getSize (int &width, int &height) |
|
virtual void | setSize (int width, int height) |
|
void | getLocationSize (int &x, int &y, int &width, int &height) |
|
void | queueDraw () |
|
GdkWindow * | getWindow () |
|
void | connect (const char *event, GCallback callback, gpointer data) |
|
void | connectAfter (const char *event, GCallback callback, gpointer data) |
|
void | connectExposeEventCallback (GCallback callback, void *data) |
|
void | connectExposeEventCallback (GtkWidget *w, GCallback callback, void *data) |
|
void | connectConfigureEventCallback (GCallback callback, void *data) |
|
void | connectConfigureEventCallback (GtkWidget *w, GCallback callback, void *data) |
|
Widget & | operator<< (DragNDrop &dnd) |
|
Widget & | operator>> (DragNDrop &dnd) |
|
|
virtual bool | checkDropValidity (GtkWidget *w, GtkWidget *sourceWidget, int info, const unsigned char *selectionStoredData) |
|
virtual bool | dragDataReceived (GtkWidget *w, GtkWidget *sourceWidget, int info, const unsigned char *selectionStoredData, int length) |
|
virtual void | dragLeave (GtkWidget *w, GtkWidget *sourceWidget) |
|
virtual bool | dragMotion (GtkWidget *w, GtkWidget *sourceWidget, int x, int y) |
|
virtual int | chooseTheTargetToUse (GtkWidget *w, GtkWidget *sourceWidget, DragNDrop &dnd) |
|
virtual void | dragDataGet (GtkWidget *w, GtkSelectionData *selectionData, guint info) |
|
virtual void | dragDataDelete (GtkWidget *w) |
|
virtual void | dragBegin (GtkWidget *w) |
|
virtual void | dragEnd (GtkWidget *w) |
|
|
static void | dragDataReceivedStatic (GtkWidget *w, GdkDragContext *dragContext, gint x, gint y, GtkSelectionData *selectionData, guint info, guint time, gpointer data) |
|
static void | dragLeaveStatic (GtkWidget *w, GdkDragContext *dragContext, guint time, gpointer data) |
|
static gboolean | dragMotionStatic (GtkWidget *w, GdkDragContext *dragContext, gint x, gint y, guint time, gpointer data) |
|
static bool | dragDropStatic (GtkWidget *w, GdkDragContext *dragContext, gint x, gint y, guint time, gpointer data) |
|
static void | dragDataGetStatic (GtkWidget *w, GdkDragContext *dragContext, GtkSelectionData *selectionData, guint info, guint time, gpointer data) |
|
static void | dragDataDeleteStatic (GtkWidget *w, GdkDragContext *dragContext, gpointer data) |
|
static void | dragBeginStatic (GtkWidget *w, GdkDragContext *dragContext, gpointer data) |
|
static void | dragEndStatic (GtkWidget *w, GdkDragContext *dragContext, gpointer data) |
|
Encapsulates the GtkWidget object
- Examples:
- DragNDropNowindowTest.C, DragNDropSimpleTest.C, DragNDropTest.C, and WidgetTest.C.
Definition at line 31 of file Widget.H.
◆ Widget() [1/2]
◆ Widget() [2/2]
Widget::Widget |
( |
GtkWidget * |
w | ) |
|
|
inline |
Construct this class given a widget.
- Parameters
-
Definition at line 43 of file Widget.H.
◆ ~Widget()
virtual Widget::~Widget |
( |
| ) |
|
|
inlinevirtual |
Destructor.
Definition at line 47 of file Widget.H.
◆ checkDropValidity()
virtual bool Widget::checkDropValidity |
( |
GtkWidget * |
w, |
|
|
GtkWidget * |
sourceWidget, |
|
|
int |
info, |
|
|
const unsigned char * |
selectionStoredData |
|
) |
| |
|
inlineprotectedvirtual |
Executed when a motion even requests knowledge from dragDataReceivedStatic as to whether the data is valid or not.
- Parameters
-
w | the GtkWidget which is the destination of the drag. |
info | the info that has been registered with the target in the GtkTargetList. |
selectionStoredData | The raw data which is sent by the other side, cast to a unsigned char pointer. |
- Returns
- true if the data will be accepted or false on failure
Definition at line 530 of file Widget.H.
◆ chooseTheTargetToUse()
virtual int Widget::chooseTheTargetToUse |
( |
GtkWidget * |
w, |
|
|
GtkWidget * |
sourceWidget, |
|
|
DragNDrop & |
dnd |
|
) |
| |
|
inlineprotectedvirtual |
Executed when the target is dropped. This method specifies which target of all of the known targets to use. If there are zero known targets, the error is returned. If there is only one target, it is returned. Otherwise, you must overload this method. If you overload this method, be sure to check for and return <0 when the known target list is empty, like so :
if (dnd.size()==0)
if (dnd.size()==1)
return 0;
- Parameters
-
w | the GtkWidget which is the destination of the drag. |
sourceWidget | The widget being dragged. |
dnd | The drag and drop data contexts |
- Returns
- the number matching the desired target data record from the DragNDrop::targets class. Returns <0 on error.
Reimplemented in JackBaseWithPortNamesGui.
Definition at line 582 of file Widget.H.
◆ connect()
void Widget::connect |
( |
const char * |
event, |
|
|
GCallback |
callback, |
|
|
gpointer |
data |
|
) |
| |
|
inline |
Connect a signal callback.
- Parameters
-
event | the signal to generate the callback e.g. "expose-event" |
callback | the callback to call |
data | the user data to pass to the callback |
Definition at line 224 of file Widget.H.
◆ connectAfter()
void Widget::connectAfter |
( |
const char * |
event, |
|
|
GCallback |
callback, |
|
|
gpointer |
data |
|
) |
| |
|
inline |
Connect a signal callback after the other callbacks have run.
- Parameters
-
event | the signal to generate the callback e.g. "expose-event" |
callback | the callback to call |
data | the user data to pass to the callback |
Definition at line 233 of file Widget.H.
◆ connectConfigureEventCallback() [1/2]
void Widget::connectConfigureEventCallback |
( |
GCallback |
callback, |
|
|
void * |
data |
|
) |
| |
|
inline |
Connect a callback function for when the widget is configured. This includes size, position and stacking changes.
Your expose event should be of the following definition : static gboolean callback(GtkWidget *widget, GdkEventConfigure *event, gpointer data);
The callback returns true to stop/complete processing of the expose signal or false to continue.
- Parameters
-
callback | The callback to execute |
data | The user data to pass to the callback |
Definition at line 270 of file Widget.H.
◆ connectConfigureEventCallback() [2/2]
void Widget::connectConfigureEventCallback |
( |
GtkWidget * |
w, |
|
|
GCallback |
callback, |
|
|
void * |
data |
|
) |
| |
|
inline |
Connect a callback function for when the widget is configured. This includes size, position and stacking changes.
Your expose event should be of the following definition : static gboolean callback(GtkWidget *widget, GdkEventConfigure *event, gpointer data);
The callback returns true to stop/complete processing of the expose signal or false to continue.
- Parameters
-
w | The widget to connect the signal handler to. |
callback | The callback to execute |
data | The user data to pass to the callback |
Definition at line 283 of file Widget.H.
◆ connectExposeEventCallback() [1/2]
void Widget::connectExposeEventCallback |
( |
GCallback |
callback, |
|
|
void * |
data |
|
) |
| |
|
inline |
Connect a callback function for when the widget is exposed.
Your expose event should be of the following definition : static gboolean callback(GtkWidget *widget, GdkEventExpose *event, gpointer data);
The callback returns true to stop/complete processing of the expose signal or false to continue.
- Parameters
-
callback | The callback to execute |
data | The user data to pass to the callback |
Definition at line 245 of file Widget.H.
◆ connectExposeEventCallback() [2/2]
void Widget::connectExposeEventCallback |
( |
GtkWidget * |
w, |
|
|
GCallback |
callback, |
|
|
void * |
data |
|
) |
| |
|
inline |
Connect a callback function for when the widget is exposed.
Your expose event should be of the following definition : static gboolean callback(GtkWidget *widget, GdkEventExpose *event, gpointer data);
The callback returns true to stop/complete processing of the expose signal or false to continue.
- Parameters
-
w | The widget to connect the signal handler to. |
callback | The callback to execute |
data | The user data to pass to the callback |
Definition at line 258 of file Widget.H.
◆ dragBegin()
virtual void Widget::dragBegin |
( |
GtkWidget * |
w | ) |
|
|
inlineprotectedvirtual |
Executed on the drag source when a drag is started. A typical reason to connect to this signal is to set up a custom drag icon with gtk_drag_source_set_icon().
- Parameters
-
w | the object which is the source of the drag. |
Definition at line 621 of file Widget.H.
◆ dragBeginStatic()
static void Widget::dragBeginStatic |
( |
GtkWidget * |
w, |
|
|
GdkDragContext * |
dragContext, |
|
|
gpointer |
data |
|
) |
| |
|
inlinestaticprivate |
Executed on the drag source when a drag is started. A typical reason to connect to this signal is to set up a custom drag icon with gtk_drag_source_set_icon().
- Parameters
-
w | the object which is the source of the drag. |
dragContext | the drag context. |
data | user data set when the signal handler was connected, typically the widget which executed the operator>> |
Definition at line 506 of file Widget.H.
◆ dragDataDelete()
virtual void Widget::dragDataDelete |
( |
GtkWidget * |
w | ) |
|
|
inlineprotectedvirtual |
Executed for deleting the data that has been dropped. Overload this method to execute something when something has to change to your application once the data has been successfully dropped.
- Parameters
-
w | the object which is the source of the drag. |
Definition at line 613 of file Widget.H.
◆ dragDataDeleteStatic()
static void Widget::dragDataDeleteStatic |
( |
GtkWidget * |
w, |
|
|
GdkDragContext * |
dragContext, |
|
|
gpointer |
data |
|
) |
| |
|
inlinestaticprivate |
Executed for deleting the data that has been dropped.
- Parameters
-
w | the object which is sending the data. |
dragContext | the drag context. |
data | user data set when the signal handler was connected, typically the widget which executed the operator>> |
Definition at line 495 of file Widget.H.
◆ dragDataGet()
virtual void Widget::dragDataGet |
( |
GtkWidget * |
w, |
|
|
GtkSelectionData * |
selectionData, |
|
|
guint |
info |
|
) |
| |
|
inlineprotectedvirtual |
Overload this to allow your source to send data. This method is executed when the destination requests the data. You can send data by loading in to the selectionData using one of the gtk_selection_data_set methods, which include the following functions : gtk_selection_data_set, gtk_selection_data_set_text, gtk_selection_data_set_pixbuf, gtk_selection_data_set_uris. Executed by the drag source when the drop site requests the data which is dragged. It fulls the selectionData. An example use of the function is :
gtk_selection_data_set(selectionData, gtk_selection_data_get_target(selectionData), sizeof(gunsigned char), (gunsigned char*) string_data, strlen(string_data));
- Parameters
-
w | the object which is the source of the drag. |
selectionData | the data to send. |
info | the info that has been registered with the target in the GtkTargetList. |
Reimplemented in ClientIOGui.
- Examples:
- DragNDropTest.C.
Definition at line 605 of file Widget.H.
◆ dragDataGetStatic()
static void Widget::dragDataGetStatic |
( |
GtkWidget * |
w, |
|
|
GdkDragContext * |
dragContext, |
|
|
GtkSelectionData * |
selectionData, |
|
|
guint |
info, |
|
|
guint |
time, |
|
|
gpointer |
data |
|
) |
| |
|
inlinestaticprivate |
Executed by the drag source when the drop site requests the data which is dragged. It fulls the selectionData.
- Parameters
-
w | the object which is sending the data. |
dragContext | the drag context. |
selectionData | the data to send. |
info | the info that has been registered with the target in the GtkTargetList. |
time | the time stamp at which the data was requested. |
data | user data set when the signal handler was connected, typically the widget which executed the operator>> |
Definition at line 484 of file Widget.H.
◆ dragDataReceived()
virtual bool Widget::dragDataReceived |
( |
GtkWidget * |
w, |
|
|
GtkWidget * |
sourceWidget, |
|
|
int |
info, |
|
|
const unsigned char * |
selectionStoredData, |
|
|
int |
length |
|
) |
| |
|
inlineprotectedvirtual |
Executed when the user drops and completes. You must overload this method to execute on the data passed during the drop.
- Parameters
-
w | the GtkWidget which is the destination of the drag. |
info | the info that has been registered with the target in the GtkTargetList. |
selectionStoredData | The raw data which is sent by the other side, cast to a unsigned char pointer. |
length | The length of the stored data |
- Returns
- true on success or false on failure
Reimplemented in JackBaseWithPortNamesGui.
- Examples:
- DragNDropTest.C.
Definition at line 542 of file Widget.H.
◆ dragDataReceivedStatic()
static void Widget::dragDataReceivedStatic |
( |
GtkWidget * |
w, |
|
|
GdkDragContext * |
dragContext, |
|
|
gint |
x, |
|
|
gint |
y, |
|
|
GtkSelectionData * |
selectionData, |
|
|
guint |
info, |
|
|
guint |
time, |
|
|
gpointer |
data |
|
) |
| |
|
inlinestaticprivate |
Executed on the drop site when the dragged data has been received. Also executed when a drag motion event requests knowledge on whether the drop will be accepted successfully or not.
- Parameters
-
w | the GtkWidget which is the destination of the drag. |
dragContext | the drag context. |
x | where the drop happened. |
y | where the drop happened. |
selectionData | the received data. |
info | the info that has been registered with the target in the GtkTargetList. |
time | the timestamp at which the data was received. |
data | user data set when the signal handler was connected, typically the widget which executed the operator<< |
Definition at line 346 of file Widget.H.
◆ dragDropStatic()
static bool Widget::dragDropStatic |
( |
GtkWidget * |
w, |
|
|
GdkDragContext * |
dragContext, |
|
|
gint |
x, |
|
|
gint |
y, |
|
|
guint |
time, |
|
|
gpointer |
data |
|
) |
| |
|
inlinestaticprivate |
Executed when the user drops the data onto the widget. The user must determine whether is has been dropped onto a suitable drop zone.
- Parameters
-
w | the GtkWidget which is the destination of the drag. |
dragContext | the drag context. |
x | where the drop happened. |
y | where the drop happened. |
time | the timestamp at which the data was received. |
data | user data set when the signal handler was connected, typically the widget which executed the operator<< |
- Returns
- true if in the drop zone, valid data and to be accepted, false otherwise.
Definition at line 450 of file Widget.H.
◆ dragEnd()
virtual void Widget::dragEnd |
( |
GtkWidget * |
w | ) |
|
|
inlineprotectedvirtual |
Executed on the drag source when a drag is finished. A typical reason to connect to this signal is to undo things done in dragBegin.
- Parameters
-
w | the object which is the source of the drag. |
Definition at line 629 of file Widget.H.
◆ dragEndStatic()
static void Widget::dragEndStatic |
( |
GtkWidget * |
w, |
|
|
GdkDragContext * |
dragContext, |
|
|
gpointer |
data |
|
) |
| |
|
inlinestaticprivate |
Executed on the drag source when a drag is finished. A typical reason to connect to this signal is to undo things done in dragBegin.
- Parameters
-
w | the object which is the source of the drag. |
dragContext | the drag context. |
data | user data set when the signal handler was connected, typically the widget which executed the operator>> |
Definition at line 517 of file Widget.H.
◆ dragHighlight()
virtual void Widget::dragHighlight |
( |
GtkWidget * |
w | ) |
|
|
inlineprivatevirtual |
Executed when the widget must be highlighted.
- Parameters
-
w | the GtkWidget which is the destination of the drag. |
Definition at line 433 of file Widget.H.
◆ dragLeave()
virtual void Widget::dragLeave |
( |
GtkWidget * |
w, |
|
|
GtkWidget * |
sourceWidget |
|
) |
| |
|
inlineprotectedvirtual |
Executed when the cursor leaves the drop widget. A typical reason to execute this method is to undo things executed in dragMotion.
- Parameters
-
w | the GtkWidget which is the destination of the drag. |
Definition at line 551 of file Widget.H.
◆ dragLeaveStatic()
static void Widget::dragLeaveStatic |
( |
GtkWidget * |
w, |
|
|
GdkDragContext * |
dragContext, |
|
|
guint |
time, |
|
|
gpointer |
data |
|
) |
| |
|
inlinestaticprivate |
Executed when the cursor leaves the drop widget. A typical reason to exectue this method is to undo things executed in dragMotionStatic.
- Parameters
-
w | the GtkWidget which is the destination of the drag. |
dragContext | the drag context. |
time | the timestamp at which the data was received. |
data | user data set when the signal handler was connected, typically the widget which executed the operator<< |
Definition at line 388 of file Widget.H.
◆ dragMotion()
virtual bool Widget::dragMotion |
( |
GtkWidget * |
w, |
|
|
GtkWidget * |
sourceWidget, |
|
|
int |
x, |
|
|
int |
y |
|
) |
| |
|
inlineprotectedvirtual |
Executed to work out whether the drop action will be successful or not based on current location and the user data. This is currently executed when the user drops the widget on the target.
- Parameters
-
w | the GtkWidget which is the destination of the drag. |
x | where the drop happened. |
y | where the drop happened. |
- Returns
- true if in the drop zone and to be accepted. false otherwise and no more processing.
Definition at line 562 of file Widget.H.
◆ dragMotionStatic()
static gboolean Widget::dragMotionStatic |
( |
GtkWidget * |
w, |
|
|
GdkDragContext * |
dragContext, |
|
|
gint |
x, |
|
|
gint |
y, |
|
|
guint |
time, |
|
|
gpointer |
data |
|
) |
| |
|
inlinestaticprivate |
Executed when the user moves the cursor over the drop widget during a drag.
- Parameters
-
w | the GtkWidget which is the destination of the drag. |
dragContext | the drag context. |
x | where the drop happened. |
y | where the drop happened. |
time | the timestamp at which the data was received. |
data | user data set when the signal handler was connected, typically the widget which executed the operator<< |
- Returns
- true if in the drop zone and to be accepted. false otherwise and no more processing.
Definition at line 413 of file Widget.H.
◆ dragUnhighlight()
virtual void Widget::dragUnhighlight |
( |
GtkWidget * |
w | ) |
|
|
inlineprivatevirtual |
Executed when the widget must be 'unhighlighted'.
- Parameters
-
w | the GtkWidget which is the destination of the drag. |
Definition at line 397 of file Widget.H.
◆ getLocationSize()
void Widget::getLocationSize |
( |
int & |
x, |
|
|
int & |
y, |
|
|
int & |
width, |
|
|
int & |
height |
|
) |
| |
|
inline |
Find the widgets location and size.
- Parameters
-
[out] | x | The x location |
[out] | y | The y location |
[out] | width | The width |
[out] | height | The height |
Definition at line 142 of file Widget.H.
◆ getSensitive()
bool Widget::getSensitive |
( |
void |
| ) |
|
|
inline |
Set whether the widget is sensitive or not.
- Returns
- True if sensitive or false if not.
Definition at line 98 of file Widget.H.
◆ getSize()
void Widget::getSize |
( |
int & |
width, |
|
|
int & |
height |
|
) |
| |
|
inline |
Find the prefered size of the widget.
- Parameters
-
[out] | width | the width of the widget |
[out] | height | the height of the widget |
- Examples:
- SelectionAreaTest.C.
Definition at line 113 of file Widget.H.
◆ getVisible()
bool Widget::getVisible |
( |
void |
| ) |
|
|
inline |
Find whether a widget is visible.
- Returns
- true if visible, false if not.
Definition at line 80 of file Widget.H.
◆ getWidget()
GtkWidget* Widget::getWidget |
( |
void |
| ) |
|
|
inline |
◆ getWindow()
GdkWindow* Widget::getWindow |
( |
| ) |
|
|
inline |
Get the parent window of the widget
Definition at line 159 of file Widget.H.
◆ hide()
GtkWidget* Widget::hide |
( |
void |
| ) |
|
|
inline |
Method to hide the widget.
- Returns
- box the GtkWidget* to the box
Definition at line 72 of file Widget.H.
◆ operator<<()
Make this widget a destination by adding a set of drag and drop targets to this widget. This widget becomes a drag and drop destination (sink)
- Parameters
-
dnd | The DragNDrop class specifying the set of targets. |
Definition at line 293 of file Widget.H.
◆ operator>>()
Make this widget a source by adding a set of drag and drop targets to this widget. This widget becomes a drag and drop source
- Parameters
-
dnd | The DragNDrop class specifying the set of targets. |
Definition at line 318 of file Widget.H.
◆ queueDraw()
void Widget::queueDraw |
( |
| ) |
|
|
inline |
queue the widget for redrawing
Definition at line 153 of file Widget.H.
◆ ref()
GtkWidget* Widget::ref |
( |
void |
| ) |
|
|
inline |
Add a reference to the widget
Definition at line 51 of file Widget.H.
◆ setSensitive()
void Widget::setSensitive |
( |
bool |
sens | ) |
|
|
inline |
Set whether the widget is sensitive or not.
- Parameters
-
sens | True if sensitive or false if not. |
Definition at line 105 of file Widget.H.
◆ setSize()
virtual void Widget::setSize |
( |
int |
width, |
|
|
int |
height |
|
) |
| |
|
inlinevirtual |
Put in a request to change the prefered size of the widget.
- Parameters
-
width | the width of the widget |
height | the height of the widget |
- Examples:
- SelectionAreaTest.C.
Definition at line 132 of file Widget.H.
◆ show()
GtkWidget* Widget::show |
( |
void |
| ) |
|
|
inline |
Method to show the widget.
- Returns
- box the GtkWidget* to the box
- Examples:
- AlignmentTest.C, ButtonsFontTest.C, ButtonsTest.C, ButtonsTest2.C, ComboBoxTextTest.C, DragNDropNowindowTest.C, DragNDropSimpleTest.C, DragNDropTest.C, DrawingAreaTest.C, InlineTest.C, LabelsTest.C, LabelsTest2.C, LabelsTest3.C, MessageDialogTest.C, NeuralNetworkFnTest.C, PangoTest.C, PangoTest2.C, PixmapTest.C, ProgressBarTest.C, SelectionAreaTest.C, SelectionTest.C, SelectionTest2.C, SelectionTest3.C, SeparatorTest.C, TableTest.C, TextViewTest.C, and WidgetTest.C.
Definition at line 65 of file Widget.H.
◆ unref()
void Widget::unref |
( |
void |
| ) |
|
|
inline |
Remove a reference from the widget
Definition at line 58 of file Widget.H.
◆ widget
GtkWidget* Widget::widget |
|
protected |
The container based widget.
Definition at line 33 of file Widget.H.
The documentation for this class was generated from the following file: