Re: marks API



On 10 Jul 2000, Havoc Pennington wrote:

> Hi,
> 
> Marks are pretty trivial, and the main manipulation of them is via 
> the GtkTextBuffer methods. However they do have some methods. 
> Basically a mark can be visible (the cursor for example) or not. They
> can be named or anonymous, like tags. They are reference counted,
> but have a "deleted" state similar to the destroyed state of objects
> (deleted just means it's removed from the buffer).
> 
> Havoc
> 
> #ifndef GTK_TEXT_MARK_H
> #define GTK_TEXT_MARK_H
> 
> #ifdef __cplusplus
> extern "C" {
> #endif /* __cplusplus */
> 
> /* The GtkTextMark data type */
> 
> typedef struct _GtkTextMark GtkTextMark;
> 
> void gtk_text_mark_set_visible (GtkTextMark *mark,
>                                 gboolean setting);

what is this doing exactly? how is a mark being visualized?
do i get multiple "cursors" if more than one mark is visible?

> gboolean gtk_text_mark_is_visible (GtkTextMark *mark);
> char *   gtk_text_mark_get_name   (GtkTextMark *mark);

can we finally use g* prefixed types? yes?

> GtkTextMark *gtk_text_mark_ref (GtkTextMark *mark);
> void         gtk_text_mark_unref (GtkTextMark *mark);

how's that implemented?
is a mark something like a pseudo-object?
why could there be a need to reference marks?

what do i need marks for?
(other than getting a name that i couldn't set through the
gtk_text_mark_* API)

> 
> gboolean   gtk_text_mark_deleted (GtkTextMark *mark);

this simply returns whether a mark got deleted meanwhile?
could i get "delete notification" of such an event occouring?

> 
> #ifdef __cplusplus
> }
> #endif /* __cplusplus */

i guess i need to deeply dive into your text widget implementation
before i can provide you with reasonable comments on your TextMark
API, unless you give a little more context.

[this is meant as general criticism on your "API-review" postals,
for a large part, they mostly contain <code> and maybe a short blurb
if the reader is lucky]

> 
> #endif
> 

---
ciaoTJ





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]