예제 #1
0
파일: ml_gtktext.c 프로젝트: knuton/lablgtk
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);
}
예제 #2
0
//===================================================================
  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

}
예제 #3
0
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);
	}
}
예제 #4
0
/*#
    @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();
}
예제 #5
0
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);
    }
}