CuiRectangle

Name

CuiRectangle -- 

Synopsis


#include <history.h>


            CuiRectangle;
CuiWidget*  cui_rectangle_new               (void);
void        cui_rectangle_set_color         (CuiRectangle *rec,
                                             const char *color_name,
                                             const char *high_color_name,
                                             const char *low_color_name);
GdkColor*   cui_rectangle_get_color         (CuiRectangle *rec);
GdkColor*   cui_rectangle_get_high_color    (CuiRectangle *rec);
GdkColor*   cui_rectangle_get_low_color     (CuiRectangle *rec);
void        cui_rectangle_set_is_dnd_source (CuiRectangle *rectangle,
                                             gboolean is_dnd_source);
gboolean    cui_rectangle_is_dnd_source     (CuiRectangle *rectangle);
void        cui_rectangle_set_dnd_source_data
                                            (CuiRectangle *rectangle,
                                             TargetType source_type,
                                             gpointer source_data,
                                             gsize source_size);
void        cui_rectangle_set_is_dnd_target (CuiRectangle *rectangle,
                                             gboolean is_dnd_target);
gboolean    cui_rectangle_is_dnd_target     (CuiRectangle *rectangle);
void        cui_rectangle_set_target_list   (CuiRectangle *rec,
                                             GtkTargetList *list);
GtkTargetList* cui_rectangle_get_target_list
                                            (CuiRectangle *rec);
void        cui_rectangle_set_target_object (CuiRectangle *rec,
                                             GObject *object);
gboolean    cui_rectangle_set_highlighted   (CuiRectangle *rectangle,
                                             gboolean highlighted);
gboolean    cui_rectangle_redraw            (CuiRectangle *rectangle,
                                             gint debug);
guint       cui_rectangle_get_expose_signal_id
                                            (void);

Object Hierarchy


  GObject
   +----CuiWidget
         +----CuiRectangle
               +----CuiRectangleEmboss
               +----CuiSizeBar
               +----CuiFrame
               +----CuiWindow

Properties


  "color"                gpointer              : Read / Write
  "high-color"           gpointer              : Read / Write
  "is-dnd-source"        gboolean              : Read / Write
  "is-dnd-target"        gboolean              : Read / Write
  "is-highlighted"       gboolean              : Read / Write
  "low-color"            gpointer              : Read / Write
  "target-list"          gpointer              : Read / Write
  "target-object"        gpointer              : Read / Write

Signal Prototypes


"drop-data-received"
            void        user_function      (CuiRectangle *cuirectangle,
                                            gpointer arg1,
                                            gpointer user_data);
"expose"    gboolean    user_function      (CuiRectangle *cuirectangle,
                                            gint arg1,
                                            gpointer user_data);

Description

Details

CuiRectangle

typedef struct {
	gboolean        is_dnd_target;
	gboolean        is_dnd_source;
	gboolean        is_highlighted;
	TargetType      source_type;
	gpointer        source_data;
	gsize           source_size;	
	GtkTargetList  *target_list;
	gpointer        target_object;
} CuiRectangle;

The base class for rectangular passive widgets such as frames, embossed color rectangles.

gboolean is_dnd_target;

TRUE if the rectangle can be a Drag&Drop target

gboolean is_dnd_source;

TRUE if the rectangle can be a Drag&Drop source

gboolean is_highlighted;

TRUE if the rectangle is highlighted (drag-motion)

TargetType source_type;

the type of the data we drag from here

gpointer source_data;

the data we drag from here

gsize source_size;

the size of the data we drag from here

GtkTargetList *target_list;

the GtktargetList of acceptable DnD types

gpointer target_object;

the G_OBJECT which act as a the target for the DnD


cui_rectangle_new ()

CuiWidget*  cui_rectangle_new               (void);

Creates a new rectangle.

Returns :

a new CuiRectangle as CuiWidget


cui_rectangle_set_color ()

void        cui_rectangle_set_color         (CuiRectangle *rec,
                                             const char *color_name,
                                             const char *high_color_name,
                                             const char *low_color_name);

Sets the three colors for the frame. The function also allocates these colors for the Background of the widget.

rec :

a CuiRectangle widget

color_name :

the color for the widget

high_color_name :

the high color

low_color_name :

the low color


cui_rectangle_get_color ()

GdkColor*   cui_rectangle_get_color         (CuiRectangle *rec);

Returns the color of the rectangle.

rec :

a CuiRectangle

Returns :

the color of the rectangle as a GdkColor


cui_rectangle_get_high_color ()

GdkColor*   cui_rectangle_get_high_color    (CuiRectangle *rec);

Returns the color of the rectangle.

rec :

a CuiRectangle

Returns :

the color of the rectangle as a GdkColor


cui_rectangle_get_low_color ()

GdkColor*   cui_rectangle_get_low_color     (CuiRectangle *rec);

Returns the color of the rectangle.

rec :

a CuiRectangle

Returns :

the color of the rectangle as a GdkColor


cui_rectangle_set_is_dnd_source ()

void        cui_rectangle_set_is_dnd_source (CuiRectangle *rectangle,
                                             gboolean is_dnd_source);

Sets the "is_dnd_source" property which is TRUE if this rectangle can be a Drag&Drop source.

rectangle :

a CuiRectangle

is_dnd_source :

the new value of the is_dnd_source property


cui_rectangle_is_dnd_source ()

gboolean    cui_rectangle_is_dnd_source     (CuiRectangle *rectangle);

Returns TRUE if the rectangle can be a Drag&Drop source.

rectangle :

a CuiRectangle

Returns :

TRUE if the rectangle can be a Drag&Drop source


cui_rectangle_set_dnd_source_data ()

void        cui_rectangle_set_dnd_source_data
                                            (CuiRectangle *rectangle,
                                             TargetType source_type,
                                             gpointer source_data,
                                             gsize source_size);

Sets the information needed to start a Drag&Drop operation. Every DnD source is capable of initializing a one type DnD operation.

rectangle :

a CuiRectangle

source_type :

a TargetType type source type identifier

source_data :

the dragged data pointer

source_size :

the size of the source_data


cui_rectangle_set_is_dnd_target ()

void        cui_rectangle_set_is_dnd_target (CuiRectangle *rectangle,
                                             gboolean is_dnd_target);

Sets the "is_dnd_target" property which is TRUE if this rectangle can be a Drag&Drop target.

rectangle :

a CuiRectangle

is_dnd_target :

the new value of the is_dnd_target property


cui_rectangle_is_dnd_target ()

gboolean    cui_rectangle_is_dnd_target     (CuiRectangle *rectangle);

Returns TRUE if the rectangle can be a Drag&Drop target.

rectangle :

a CuiRectangle

Returns :

TRUE if the rectangle can be a Drag&Drop target


cui_rectangle_set_target_list ()

void        cui_rectangle_set_target_list   (CuiRectangle *rec,
                                             GtkTargetList *list);

Sets the target list of the rectangle. This list is storing the data types this rectangle can handle as DnD target.

rec :

a CuiRectangle

list :

a new GtkTargetList for this rectangle


cui_rectangle_get_target_list ()

GtkTargetList* cui_rectangle_get_target_list
                                            (CuiRectangle *rec);

Returns the GtkTargetList of the rectangle. This list contains the DnD types this rectangle can handle as a target.

rec :

a CuiRectangle

Returns :

the target list of the rectangle


cui_rectangle_set_target_object ()

void        cui_rectangle_set_target_object (CuiRectangle *rec,
                                             GObject *object);

Sets the Drag&Drop target object for the rectangle. The rectangle will hold a reference of the object until we change the target.

rec :

a CuiRectangle

object :

the new target object


cui_rectangle_set_highlighted ()

gboolean    cui_rectangle_set_highlighted   (CuiRectangle *rectangle,
                                             gboolean highlighted);

Sets the highlight status of the rectangle. The rectangle is highlighted when the mouse is moving over it during a Drag&Drop operation. The function redrawi the rectangle if necessary.

rectangle :

a CuiRectangle

highlighted :

if the rectangle widget is highlighted

Returns :

the original highlight status of the rectangle


cui_rectangle_redraw ()

gboolean    cui_rectangle_redraw            (CuiRectangle *rectangle,
                                             gint debug);

Emits the expose event for the widget to redraw the screen.

rectangle :

the CuiRectangle to redraw

debug :

if this argument is not 0 the area will be highlighted

Returns :

the return value of the signal handler


cui_rectangle_get_expose_signal_id ()

guint       cui_rectangle_get_expose_signal_id
                                            (void);

Returns the id of the "expose" signal. This function is for internal use only.

Returns :

the numerical id of the "expose" signal

Properties

The "color" property

  "color"                gpointer              : Read / Write

The color of the rectangle.


The "high-color" property

  "high-color"           gpointer              : Read / Write

The color of the upper left part of the rectangle.


The "is-dnd-source" property

  "is-dnd-source"        gboolean              : Read / Write

If the rectangle can be a Drag&Drop source.

Default value: FALSE


The "is-dnd-target" property

  "is-dnd-target"        gboolean              : Read / Write

If the rectangle can be a Drag&Drop target.

Default value: FALSE


The "is-highlighted" property

  "is-highlighted"       gboolean              : Read / Write

If the rectangle is highlighted (DnD motion).

Default value: FALSE


The "low-color" property

  "low-color"            gpointer              : Read / Write

The color of the upper right part of the rectangle.


The "target-list" property

  "target-list"          gpointer              : Read / Write

The GtkTargetList shows what can this rectangle accept as a DnD target.


The "target-object" property

  "target-object"        gpointer              : Read / Write

The GObject we use as a DnD target.

Signals

The "drop-data-received" signal

void        user_function                  (CuiRectangle *cuirectangle,
                                            gpointer arg1,
                                            gpointer user_data);

arg1 :

@: @: @: @: @:

cuirectangle :

the object which received the signal. @: @: @: @:

user_data :

user data set when the signal handler was connected.


The "expose" signal

gboolean    user_function                  (CuiRectangle *cuirectangle,
                                            gint arg1,
                                            gpointer user_data);

user_data :

user data set when the signal handler was connected.

Returns :