swamigui Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy |
enum SwamiguiPasteStatus; enum SwamiguiPasteDecision; SwamiguiPaste; SwamiguiPaste * swamigui_paste_new (void
); gboolean swamigui_paste_process (SwamiguiPaste *paste
); void swamigui_paste_set_items (SwamiguiPaste *paste
,IpatchItem *dstitem
,GList *srcitems
); void swamigui_paste_get_conflict_items (SwamiguiPaste *paste
,IpatchItem **src
,IpatchItem **dest
); void swamigui_paste_set_conflict_items (SwamiguiPaste *paste
,IpatchItem *src
,IpatchItem *dest
); void swamigui_paste_push_state (SwamiguiPaste *paste
,gpointer state
); gpointer swamigui_paste_pop_state (SwamiguiPaste *paste
);
typedef enum { SWAMIGUI_PASTE_NORMAL, /* system normal */ SWAMIGUI_PASTE_ERROR, /* an error has occured */ SWAMIGUI_PASTE_UNHANDLED, /* unhandled paste types */ SWAMIGUI_PASTE_CONFLICT, /* a conflict occured, choice required */ SWAMIGUI_PASTE_CANCEL /* cancel paste operation */ } SwamiguiPasteStatus;
typedef enum { SWAMIGUI_PASTE_NO_DECISION = 0, SWAMIGUI_PASTE_SKIP = 1 << 0, /* skip item (keep old conflict item) */ SWAMIGUI_PASTE_CHANGED = 1 << 1, /* item change (check for conflicts, etc) */ SWAMIGUI_PASTE_REPLACE = 1 << 2 /* replace conflict item */ } SwamiguiPasteDecision;
SwamiguiPaste * swamigui_paste_new (void
);
Create a new paste object.
Returns : |
New paste object with a ref count of 1. |
gboolean swamigui_paste_process (SwamiguiPaste *paste
);
Run the paste process. This function uses the IpatchPaste system to handle
paste operations. May need to be called multiple times to complete a paste
operation if decisions are required (conflict paste items, unhandled types,
or a cancel occurs). All paste status and parameters are stored in
the paste
object. This function also groups all state history actions
of the paste operation so it can be retracted if the paste is canceled.
void swamigui_paste_set_items (SwamiguiPaste *paste
,IpatchItem *dstitem
,GList *srcitems
);
A function to set the destination item and source item(s) of a paste operation. This function can only be called once on a paste object.
|
Swami paste object |
|
Destination item of paste operation |
|
A list of source IpatchItem objects |
void swamigui_paste_get_conflict_items (SwamiguiPaste *paste
,IpatchItem **src
,IpatchItem **dest
);
Get conflict items from a paste
object (paste status should be
SWAMIGUI_PASTE_CONFLICT or these will be NULL
). The returned
items' reference counts are incremented and the caller is
responsible for unrefing them with g_object_unref when finished using
them.
void swamigui_paste_set_conflict_items (SwamiguiPaste *paste
,IpatchItem *src
,IpatchItem *dest
);
Set conflict items in a paste object. This function will cause the paste
object's status to be set to SWAMIGUI_PASTE_CONFLICT if src
and
dest
are not NULL
, otherwise it will be set to
SWAMIGUI_PASTE_NORMAL status and the conflict items will be cleared.
void swamigui_paste_push_state (SwamiguiPaste *paste
,gpointer state
);
This function is used by IpatchItem interface "paste" methods to
store variable state data to be able to resume a paste operation (after
a decision is made on a conflict, etc). The paste
object stores a stack
of state data so a chain of functions can be resumed at a later time.
The methods are responsible for creating and destroying this state data
and the function chain will be resumed even on a cancel operation so this
can be accomplished properly.
|
Swami paste object |
|
IpatchItem "paste" method defined state data |
gpointer swamigui_paste_pop_state (SwamiguiPaste *paste
);
This function is used by IpatchItem interface "paste" methods to
retrieve the next variable state data, stored by
swamigui_paste_push_state()
, to be able to resume a paste
operation. The chain of functions storing state data should call
this function in the reverse order in which the states were
pushed. The state pointer is removed from the stack after this
call.
|
Swami paste object |
Returns : |
Pointer to state data which was on the top of the stack. |