CAMLprim value ml_gtk_text_mark_get_name (value tm) { CAMLparam1(tm); CAMLlocal1(res); const gchar* tmp; tmp = gtk_text_mark_get_name(GtkTextMark_val(tm)); res = Val_option(tmp,Val_string); CAMLreturn(res); }
//=================================================================== int GUI_ed1_cb2 (void *parent, void *iter, void *mark, MemObj mo) { //=================================================================== /// \code /// INTERNAL 'set-mark'-callback /// \endcode Obj_gui1 *go; long cpos, lnr; int ikey, imod, iEv; const char *p1; void *pTab[3]; // printf("GUI_ed1_cb2 GUI_ed1_stat=%d\n",GUI_ed1_stat); // skip userCalls during internal operations if(GUI_ed1_stat) return TRUE; cpos = gtk_text_iter_get_offset (iter); if(cpos == GUI_ed1_cPos) return (FALSE); GUI_ed1_cPos = cpos; // printf("GUI_ed1_cb2 %ld\n",cpos); // skip mark != "insert" p1 = gtk_text_mark_get_name (mark); if(!p1) return (FALSE); // printf(" mark-name = |%s|\n",p1); if(strcmp(p1, "insert")) return (FALSE); // TRUE: do no defaultOperations go = GUI_obj_pos (&mo); if(!go) return 0; if(!go->uFunc) return 0; iEv = TYP_EventEnter; // lnr = gtk_text_buffer_get_line_count (parent); lnr = gtk_text_iter_get_line (iter); ++lnr; // first line = 1 ! pTab[0] = &iEv; pTab[1] = &cpos; pTab[2] = &lnr; go->uFunc (go, pTab); return (FALSE); // TRUE: do no defaultOperations }
static void text_buffer_mark_set (GtkTextBuffer *buffer, GtkTextIter *iter, GtkTextMark *mark, TargetCallbackData *target_data) { /* anonymous marks with NULL names refer to cursor moves */ if (gtk_text_mark_get_name (mark) != NULL) { text_buffer_update_sensitivity (buffer, target_data); } }
/*# @method get_name GtkTextMark @brief Returns the mark name; returns nil for anonymous marks. @return mark name */ FALCON_FUNC TextMark::get_name( VMARG ) { NO_ARGS MYSELF; GET_OBJ( self ); const char* name = gtk_text_mark_get_name( (GtkTextMark*)_obj ); if ( name ) { String* s = new String( name ); s->bufferize(); vm->retval( s ); } else vm->retnil(); }
static void gtk_text_mark_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GtkTextMark *mark = GTK_TEXT_MARK (object); switch (prop_id) { case PROP_NAME: g_value_set_string (value, gtk_text_mark_get_name (mark)); break; case PROP_LEFT_GRAVITY: g_value_set_boolean (value, gtk_text_mark_get_left_gravity (mark)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); } }