Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > 76909b5763edb96a2bc7bd7fb5b301b8 > files > 37

cuiterm-0.9.9-1mdv2008.1.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML><HEAD><TITLE>Drag and Drop</TITLE><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="Cuiterm Reference Manual" HREF="index.html"><LINK REL="UP" TITLE="Cuiterm Documentation 0.5" HREF="c4.html"><LINK REL="PREVIOUS" TITLE="The BASH Parser" HREF="cuiterm-bash-parser.html"><META NAME="GENERATOR" CONTENT="GTK-Doc V1.3 (SGML mode)"><STYLE TYPE="text/css">.synopsis, .classsynopsis {
    background: #eeeeee;
    border: solid 1px #aaaaaa;
    padding: 0.5em;
}
.programlisting {
    background: #eeeeff;
    border: solid 1px #aaaaff;
    padding: 0.5em;
}
.variablelist {
    padding: 4px;
    margin-left: 3em;
}
.navigation {
    background: #ffeeee;
    border: solid 1px #ffaaaa;
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}
.navigation a {
    color: #770000;
}
.navigation a:visited {
    color: #550000;
}
.navigation .title {
    font-size: 200%;
}</STYLE></HEAD><BODY CLASS="REFENTRY" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF"><TABLE WIDTH="100%" CLASS="navigation" SUMMARY="Navigation header" CELLPADDING="2" CELLSPACING="2"><TR VALIGN="middle"><TD><A ACCESSKEY="p" HREF="cuiterm-bash-parser.html"><IMG SRC="left.png" WIDTH="24" HEIGHT="24" BORDER="0" ALT="Prev"></A></TD><TD><A ACCESSKEY="u" HREF="c4.html"><IMG SRC="up.png" WIDTH="24" HEIGHT="24" BORDER="0" ALT="Up"></A></TD><TD><A ACCESSKEY="h" HREF="index.html"><IMG SRC="home.png" WIDTH="24" HEIGHT="24" BORDER="0" ALT="Home"></A></TD><TH WIDTH="100%" align="center">Cuiterm Reference Manual</TH></TR></TABLE><H1><A NAME="CUITERM-DRAG-AND-DROP"></A>Drag and Drop</H1><DIV CLASS="REFNAMEDIV"><A NAME="AEN7699"></A><H2>Name</H2>Drag and Drop&nbsp;--&nbsp;</DIV><DIV CLASS="REFSYNOPSISDIV"><A NAME="AEN7702"></A><H2>Synopsis</H2><PRE CLASS="SYNOPSIS">&#13;#include &lt;history.h&gt;


enum        <A HREF="cuiterm-drag-and-drop.html#TARGETTYPE">TargetType</A>;
GtkTargetList* <A HREF="cuiterm-drag-and-drop.html#DND-GET-FILE-TARGET-LIST">dnd_get_file_target_list</A>     (void);
GtkTargetList* <A HREF="cuiterm-drag-and-drop.html#DND-GET-DIR-TARGET-LIST">dnd_get_dir_target_list</A>      (void);
gint        <A HREF="cuiterm-drag-and-drop.html#DND-INIT-DESTINATION">dnd_init_destination</A>            (GtkWidget *widget);
gboolean    <A HREF="cuiterm-drag-and-drop.html#ON-MAIN-WIDGET-DRAG-MOTION">on_main_widget_drag_motion</A>      (GtkWidget *widget,
                                             GdkDragContext *drag_context,
                                             gint x,
                                             gint y,
                                             guint time,
                                             gpointer user_data);
void        <A HREF="cuiterm-drag-and-drop.html#ON-MAIN-WIDGET-DRAG-DATA-GET">on_main_widget_drag_data_get</A>    (GtkWidget *widget,
                                             GdkDragContext *drag_context,
                                             GtkSelectionData *data,
                                             guint info,
                                             guint time,
                                             gpointer user_data);</PRE></DIV><DIV CLASS="REFSECT1"><A NAME="AEN7729"></A><H2>Description</H2><P></P></DIV><DIV CLASS="REFSECT1"><A NAME="AEN7732"></A><H2>Details</H2><DIV CLASS="REFSECT2"><A NAME="AEN7734"></A><H3><A NAME="TARGETTYPE"></A>enum TargetType</H3><PRE CLASS="PROGRAMLISTING">typedef enum {
	TargetTextUriList         = 0,
	TargetFileForInode        = 1, 
	TargetFileForMode         = 2, 
	TargetFileForOwner        = 3,
	TargetFileForGroupOwner   = 4,
	TargetFileForLinks        = 5,
	TargetUserName            = 6,
	TargetGroupName           = 7,
	TargetFileForSize         = 8,
	TargetFileForDate         = 9,
	TargetFileForName         = 10,
	TargetStringOption        = 11,
	TargetStringLongOption    = 12,
	TargetStringProgram       = 13,
	TargetUninitialized       = 100
} TargetType;</PRE><P></P><P></P><P></P><TABLE CLASS="variablelist" BORDER="0" CELLSPACING="0" CELLPADDING="4"><TBODY><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7743"><SPAN STYLE="white-space: nowrap"><TT CLASS="LITERAL">TargetTextUriList</TT></SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P></P></TD></TR><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7748"><SPAN STYLE="white-space: nowrap"><TT CLASS="LITERAL">TargetFileForInode</TT></SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P></P></TD></TR><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7753"><SPAN STYLE="white-space: nowrap"><TT CLASS="LITERAL">TargetFileForMode</TT></SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P></P></TD></TR><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7758"><SPAN STYLE="white-space: nowrap"><TT CLASS="LITERAL">TargetFileForOwner</TT></SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P></P></TD></TR><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7763"><SPAN STYLE="white-space: nowrap"><TT CLASS="LITERAL">TargetFileForGroupOwner</TT></SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P></P></TD></TR><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7768"><SPAN STYLE="white-space: nowrap"><TT CLASS="LITERAL">TargetFileForLinks</TT></SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P></P></TD></TR><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7773"><SPAN STYLE="white-space: nowrap"><TT CLASS="LITERAL">TargetUserName</TT></SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P> </P></TD></TR><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7778"><SPAN STYLE="white-space: nowrap"><TT CLASS="LITERAL">TargetGroupName</TT></SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P></P></TD></TR><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7783"><SPAN STYLE="white-space: nowrap"><TT CLASS="LITERAL">TargetFileForSize</TT></SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P></P></TD></TR><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7788"><SPAN STYLE="white-space: nowrap"><TT CLASS="LITERAL">TargetFileForDate</TT></SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P></P></TD></TR><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7793"><SPAN STYLE="white-space: nowrap"><TT CLASS="LITERAL">TargetFileForName</TT></SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P></P></TD></TR><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7798"><SPAN STYLE="white-space: nowrap"><TT CLASS="LITERAL">TargetStringOption</TT></SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P></P></TD></TR><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7803"><SPAN STYLE="white-space: nowrap"><TT CLASS="LITERAL">TargetStringLongOption</TT></SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P></P></TD></TR><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7808"><SPAN STYLE="white-space: nowrap"><TT CLASS="LITERAL">TargetStringProgram</TT></SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P></P></TD></TR><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7813"><SPAN STYLE="white-space: nowrap"><TT CLASS="LITERAL">TargetUninitialized</TT></SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P> the target type is not set</P></TD></TR></TBODY></TABLE></DIV><HR><DIV CLASS="REFSECT2"><A NAME="AEN7818"></A><H3><A NAME="DND-GET-FILE-TARGET-LIST"></A>dnd_get_file_target_list ()</H3><PRE CLASS="PROGRAMLISTING">GtkTargetList* dnd_get_file_target_list     (void);</PRE><P>Returns a <SPAN CLASS="TYPE">GtkTargetList</SPAN> usefull for DND target for regular files.</P><P></P><P></P><TABLE CLASS="variablelist" BORDER="0" CELLSPACING="0" CELLPADDING="4"><TBODY><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7830"><SPAN STYLE="white-space: nowrap"><SPAN CLASS="emphasis"><I CLASS="EMPHASIS">Returns</I></SPAN>&nbsp;:</SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P> a <SPAN CLASS="TYPE">GtkTargetList</SPAN> list for file target sources</P></TD></TR></TBODY></TABLE></DIV><HR><DIV CLASS="REFSECT2"><A NAME="AEN7837"></A><H3><A NAME="DND-GET-DIR-TARGET-LIST"></A>dnd_get_dir_target_list ()</H3><PRE CLASS="PROGRAMLISTING">GtkTargetList* dnd_get_dir_target_list      (void);</PRE><P>Returns a <SPAN CLASS="TYPE">GtkTargetList</SPAN> usefull for DND target for regular directories.</P><P></P><P></P><TABLE CLASS="variablelist" BORDER="0" CELLSPACING="0" CELLPADDING="4"><TBODY><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7849"><SPAN STYLE="white-space: nowrap"><SPAN CLASS="emphasis"><I CLASS="EMPHASIS">Returns</I></SPAN>&nbsp;:</SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P> a <SPAN CLASS="TYPE">GtkTargetList</SPAN> list for directory target sources</P></TD></TR></TBODY></TABLE></DIV><HR><DIV CLASS="REFSECT2"><A NAME="AEN7856"></A><H3><A NAME="DND-INIT-DESTINATION"></A>dnd_init_destination ()</H3><PRE CLASS="PROGRAMLISTING">gint        dnd_init_destination            (GtkWidget *widget);</PRE><P></P><P></P><TABLE CLASS="variablelist" BORDER="0" CELLSPACING="0" CELLPADDING="4"><TBODY><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7866"><SPAN STYLE="white-space: nowrap"><CODE CLASS="PARAMETER">widget</CODE>&nbsp;:</SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P></P></TD></TR><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7871"><SPAN STYLE="white-space: nowrap"><SPAN CLASS="emphasis"><I CLASS="EMPHASIS">Returns</I></SPAN>&nbsp;:</SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P>&#13;</P></TD></TR></TBODY></TABLE></DIV><HR><DIV CLASS="REFSECT2"><A NAME="AEN7876"></A><H3><A NAME="ON-MAIN-WIDGET-DRAG-MOTION"></A>on_main_widget_drag_motion ()</H3><PRE CLASS="PROGRAMLISTING">gboolean    on_main_widget_drag_motion      (GtkWidget *widget,
                                             GdkDragContext *drag_context,
                                             gint x,
                                             gint y,
                                             guint time,
                                             gpointer user_data);</PRE><P></P><P></P><P></P><TABLE CLASS="variablelist" BORDER="0" CELLSPACING="0" CELLPADDING="4"><TBODY><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7892"><SPAN STYLE="white-space: nowrap"><CODE CLASS="PARAMETER">widget</CODE>&nbsp;:</SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P> the <SPAN CLASS="TYPE">GtkWidget</SPAN> where the motion has been found</P></TD></TR><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7899"><SPAN STYLE="white-space: nowrap"><CODE CLASS="PARAMETER">drag_context</CODE>&nbsp;:</SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P> the drag context of the operation</P></TD></TR><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7904"><SPAN STYLE="white-space: nowrap"><CODE CLASS="PARAMETER">x</CODE>&nbsp;:</SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P> the x coordinate of the mouse</P></TD></TR><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7909"><SPAN STYLE="white-space: nowrap"><CODE CLASS="PARAMETER">y</CODE>&nbsp;:</SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P> the y coordinate of the mouse</P></TD></TR><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7914"><SPAN STYLE="white-space: nowrap"><CODE CLASS="PARAMETER">time</CODE>&nbsp;:</SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P> the time when the motion was detected</P></TD></TR><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7919"><SPAN STYLE="white-space: nowrap"><CODE CLASS="PARAMETER">user_data</CODE>&nbsp;:</SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P> the data given by the signal connection </P></TD></TR><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7924"><SPAN STYLE="white-space: nowrap"><SPAN CLASS="emphasis"><I CLASS="EMPHASIS">Returns</I></SPAN>&nbsp;:</SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P> TRUE if the motion could be handled (always returns TRUE)</P></TD></TR></TBODY></TABLE></DIV><HR><DIV CLASS="REFSECT2"><A NAME="AEN7929"></A><H3><A NAME="ON-MAIN-WIDGET-DRAG-DATA-GET"></A>on_main_widget_drag_data_get ()</H3><PRE CLASS="PROGRAMLISTING">void        on_main_widget_drag_data_get    (GtkWidget *widget,
                                             GdkDragContext *drag_context,
                                             GtkSelectionData *data,
                                             guint info,
                                             guint time,
                                             gpointer user_data);</PRE><P>Called when we initialized a DnD as a source widget and the target is asking
the data. There are some problems with this function, namely:</P><P>(1) We store the DnD source CuiWidget with the main_widget object. This is
not a nice solution IMHO.</P><P></P><P></P><TABLE CLASS="variablelist" BORDER="0" CELLSPACING="0" CELLPADDING="4"><TBODY><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7946"><SPAN STYLE="white-space: nowrap"><CODE CLASS="PARAMETER">widget</CODE>&nbsp;:</SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P> the <SPAN CLASS="TYPE">GtkTextView</SPAN> widget where the DnD was initiated </P></TD></TR><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7953"><SPAN STYLE="white-space: nowrap"><CODE CLASS="PARAMETER">drag_context</CODE>&nbsp;:</SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P> the <SPAN CLASS="TYPE">GdkDragContext</SPAN> we created at the begin</P></TD></TR><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7960"><SPAN STYLE="white-space: nowrap"><CODE CLASS="PARAMETER">data</CODE>&nbsp;:</SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P> the <SPAN CLASS="TYPE">GtkSelectionData</SPAN> we have to fill</P></TD></TR><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7967"><SPAN STYLE="white-space: nowrap"><CODE CLASS="PARAMETER">info</CODE>&nbsp;:</SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P> the size of the data units</P></TD></TR><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7972"><SPAN STYLE="white-space: nowrap"><CODE CLASS="PARAMETER">time</CODE>&nbsp;:</SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P> what was the time when the data was received</P></TD></TR><TR><TD ALIGN="LEFT" VALIGN="TOP"><A NAME="AEN7977"><SPAN STYLE="white-space: nowrap"><CODE CLASS="PARAMETER">user_data</CODE>&nbsp;:</SPAN></TD><TD ALIGN="LEFT" VALIGN="TOP"><P> pointer to the data gave by the signal connection command</P></TD></TR></TBODY></TABLE></DIV></DIV><TABLE CLASS="navigation" WIDTH="100%" SUMMARY="Navigation footer" CELLPADDING="2" CELLSPACING="2"><TR VALIGN="middle"><TD ALIGN="left"><A ACCESSKEY="p" HREF="cuiterm-bash-parser.html"><B>&lt;&lt;&lt;&nbsp;The BASH Parser</B></A></TD><TD ALIGN="right"></TD></TR></TABLE></BODY></HTML>