Exemplo n.º 1
0
Instance *RuntimeObject::msg_send(std::string signature,std::vector<Instance *>args) {
    Method *method = cls->msg_resove(signature);
    if (method) {
        return method_call(method, args);
    }
    return nullptr;
}
Exemplo n.º 2
0
bool expr_call(pass_opt_t* opt, ast_t** astp)
{
  ast_t* ast = *astp;

  if(!literal_call(ast, opt))
    return false;

  // Type already set by literal handler. Check for infertype, which is a
  // marker for typechecking default arguments.
  ast_t* type = ast_type(ast);

  if((type != NULL) && (ast_id(type) != TK_INFERTYPE))
    return true;

  AST_GET_CHILDREN(ast, positional, namedargs, lhs);

  switch(ast_id(lhs))
  {
    case TK_NEWREF:
    case TK_NEWBEREF:
    case TK_BEREF:
    case TK_FUNREF:
      return method_call(opt, ast);

    case TK_NEWAPP:
    case TK_BEAPP:
    case TK_FUNAPP:
      return partial_application(opt, astp);

    default: {}
  }

  return insert_apply(opt, astp);
}
Exemplo n.º 3
0
bool expr_call(pass_opt_t* opt, ast_t** astp)
{
  ast_t* ast = *astp;

  if(!literal_call(ast, opt))
    return false;

  // Type already set by literal handler
  if(ast_type(ast) != NULL)
    return true;

  AST_GET_CHILDREN(ast, positional, namedargs, lhs);

  switch(ast_id(lhs))
  {
    case TK_NEWREF:
    case TK_NEWBEREF:
    case TK_BEREF:
    case TK_FUNREF:
      return method_call(opt, ast);

    case TK_NEWAPP:
    case TK_BEAPP:
    case TK_FUNAPP:
      return partial_application(opt, astp);

    default: {}
  }

  return insert_apply(opt, astp);
}
Exemplo n.º 4
0
int main()
{
    init_lvm({{1024, 10}, {64,100}});

    struct lvm_small s;


    method_call( (struct lvm_value*) &s );

}
Exemplo n.º 5
0
static void drag_data_received(GtkWidget *widget, GdkDragContext *context,
				gint x, gint y, GtkSelectionData *data,
				guint info, guint time, gpointer user_data)
{
	GtkTreeModel *model = user_data;
	GtkTreePath *path;
	GtkTreeIter iter;
	DBusGProxy *source, *proxy = NULL;
	gboolean success = FALSE;

	if (gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(widget),
				x, y, &path, NULL, NULL, NULL) == FALSE)
		return;

	if (gtk_tree_model_get_iter(model, &iter, path) == FALSE)
		goto done;

	gtk_tree_model_get(model, &iter, CONNMAN_COLUMN_PROXY, &proxy, -1);

	if (data == NULL || data->length == 0)
		goto done;

	if (info != CONNMAN_SERVICE_MOVE)
		goto done;

	if (gtk_tree_model_get_iter_from_string(model, &iter,
						(gchar *) data->data) == FALSE)
		goto done;

	g_print("%s -> %s\n", (gchar *) data->data, gtk_tree_path_to_string(path));

	gtk_tree_model_get(model, &iter, CONNMAN_COLUMN_PROXY, &source, -1);

	method_call(source, "MoveBefore", dbus_g_proxy_get_path(proxy));

	g_object_unref(proxy);

	success = TRUE;

done:
	gtk_tree_path_free(path);

	gtk_drag_finish(context, success, FALSE, time);
}
Exemplo n.º 6
0
const Scalar::Temp Call_stack::method_scalar(const char* const name) {
    assertion<Runtime_exception>( method_call(name, G_SCALAR) == 1, "More than one value returned in scalar call");
    return Scalar::Temp(interp, pop(), true);
}
Exemplo n.º 7
0
const Array::Temp Call_stack::method_list(const char* name) {
    const int count = method_call(name, G_ARRAY);
    return Array::Temp(interp, pop_array(count), true);
}
Exemplo n.º 8
0
static void remove_callback(GtkWidget *widget, gpointer user_data)
{
	DBusGProxy *proxy = get_proxy(user_data);

	method_call(proxy, "Remove", NULL);
}
Exemplo n.º 9
0
static void disconnect_callback(GtkWidget *widget, gpointer user_data)
{
	DBusGProxy *proxy = get_proxy(user_data);

	method_call(proxy, "Disconnect", NULL);
}