• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ ptype函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中ptype函数的典型用法代码示例。如果您正苦于以下问题:C++ ptype函数的具体用法?C++ ptype怎么用?C++ ptype使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ptype函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: parglist

/* print out argument list of procedure */
static void
parglist (proc_list *proc, const char *addargtype)
{
  decl_list *dl;

  f_print(fout,"(");
  if (proc->arg_num < 2 && newstyle &&
      streq (proc->args.decls->decl.type, "void"))
    {
      /* 0 argument in new style:  do nothing */
    }
  else
    {
      for (dl = proc->args.decls; dl != NULL; dl = dl->next)
	{
	  ptype (dl->decl.prefix, dl->decl.type, 1);
	  if (!newstyle)
	    f_print (fout, "*");	/* old style passes by reference */

	  f_print (fout, ", ");
	}
    }
  if (mtflag)
    {
      ptype(proc->res_prefix, proc->res_type, 1);
      f_print(fout, "*, ");
    }

  f_print (fout, "%s);\n", addargtype);
}
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.toolchain,代码行数:31,代码来源:rpc_hout.c


示例2: fsstat

static void
fsstat(Req *r)
{
	int rc;
	FInfo fi;
	Aux *a = r->fid->aux;

	if(ptype(r->fid->qid.path) == Proot)
		V2D(&r->d, r->fid->qid, "");
	else if(ptype(r->fid->qid.path) == Pinfo)
		dirgeninfo(pindex(r->fid->qid.path), &r->d);
	else if(ptype(r->fid->qid.path) == Pshare)
		V2D(&r->d, r->fid->qid, a->path +1);
	else{
		memset(&fi, 0, sizeof fi);
		if(Sess->caps & CAP_NT_SMBS)
			rc = T2queryall(Sess, a->sp, mapfile(a->path), &fi);
		else
			rc = T2querystandard(Sess, a->sp, mapfile(a->path), &fi);
		if(rc == -1){
			responderrstr(r);
			return;
		}
		I2D(&r->d, a->sp, a->path, &fi);
		if(Billtrog == 0)
			upd_names(Sess, a->sp, mapfile(a->path), &r->d);
	}
	respond(r, nil);
}
开发者ID:Nurb432,项目名称:plan9front,代码行数:29,代码来源:main.c


示例3: print_pkt_derivedclass

void print_pkt_derivedclass( definition *def )
{
  version_list *vers;
  proc_list *proc;
  int i;
  const char *ext;
  int vno ;
  decl_list *dl;

  if ( def->def_kind == DEF_PROGRAM ) {

    for ( vers = def->def.pr.versions; vers != NULL; vers = vers->next){

      for (proc = vers->procs; proc != NULL;proc = proc->next){

/* Argument packet */
      dl = proc->args.decls;

      fprintf(stderr,"QCDOC-RPC derived class: ");
      fprintf(stderr,"RPCPkt_%s\n",proc->proc_name);


      f_print (fout, "\n");
      f_print (fout, "class RPCPkt_%s : public RPCPkt {",proc->proc_name);

      /*Input and output arg/result*/
      f_print (fout, "\nprivate:\n");
      f_print (fout, "\t");
      ptype(dl->decl.prefix,dl->decl.type, 1);
      f_print (fout, "in;\n");
      f_print (fout, "\t");
      ptype(proc->res_prefix,proc->res_type, 1);
      f_print (fout,"out; \n");
      f_print (fout,"\tvirtual caddr_t Request(void) { return (caddr_t)&in; } ;\n");
      f_print (fout,"\tvirtual caddr_t Reply  (void) { return (caddr_t)&out; } ;\n\n");

      f_print (fout, "\npublic:\n");

      /*Constructor*/
      f_print (fout, "   RPCPkt_%s( %s *in) :\n",proc->proc_name,dl->decl.type);
      f_print (fout,"\n");
      f_print (fout, "\tRPCPkt( (xdrproc_t)xdr_");
      ptype(dl->decl.prefix,dl->decl.type, 1);
      f_print (fout,",\n\t\t(xdrproc_t)xdr_");
      ptype(proc->res_prefix,proc->res_type, 1);
      f_print (fout,",\n\t\t%s,%s,%s",proc->proc_name,vers->vers_name,def->def_name);
      f_print (fout,") {\n");
      f_print (fout,"       xdrencode((caddr_t)in);\n");
      f_print (fout,"    };\n");

      f_print (fout,"};\n");

      }

    }

   }
}
开发者ID:DeanHowarth,项目名称:QUDA-CPS,代码行数:58,代码来源:rpc_pktout.c


示例4: printbody

static void
printbody(proc_list *proc)
{
	decl_list      *l;
	bool_t          args2 = (proc->arg_num > 1);

	/* For new style with multiple arguments, need a structure in which
         * to stuff the arguments. */
	if (newstyle && args2) {
		f_print(fout, "\t%s", proc->args.argname);
		f_print(fout, " arg;\n");
	}
	f_print(fout, "\tstatic ");
	if (streq(proc->res_type, "void")) {
		f_print(fout, "char ");
	} else {
		ptype(proc->res_prefix, proc->res_type, 0);
	}
	f_print(fout, "%s;\n", RESULT);
	f_print(fout, "\n");
	f_print(fout, "\tmemset((char *)%s%s, 0, sizeof(%s));\n",
		ampr(proc->res_type), RESULT, RESULT);
	if (newstyle && !args2 && (streq(proc->args.decls->decl.type, "void"))) {
		/* newstyle, 0 arguments */
		f_print(fout,
			"\tif (clnt_call(clnt, %s, (xdrproc_t) xdr_void, (caddr_t) NULL, "
			"(xdrproc_t) xdr_%s, (caddr_t) %s%s, TIMEOUT) != RPC_SUCCESS) {\n",
			proc->proc_name,
			stringfix(proc->res_type), ampr(proc->res_type), RESULT);

	} else if (newstyle && args2) {
		/* newstyle, multiple arguments:  stuff arguments into structure */
		for (l = proc->args.decls; l != NULL; l = l->next) {
			f_print(fout, "\targ.%s = %s;\n",
				l->decl.name, l->decl.name);
		}
		f_print(fout,
			"\tif (clnt_call(clnt, %s, (xdrproc_t) xdr_%s, (caddr_t) &arg, "
			"(xdrproc_t) xdr_%s, (caddr_t) %s%s, TIMEOUT) != RPC_SUCCESS) {\n",
			proc->proc_name, proc->args.argname,
			stringfix(proc->res_type), ampr(proc->res_type), RESULT);
	} else {		/* single argument, new or old style */
		f_print(fout,
			"\tif (clnt_call(clnt, %s, (xdrproc_t) xdr_%s, "
			"(caddr_t) %s%s, (xdrproc_t) xdr_%s, (caddr_t) %s%s, TIMEOUT) != RPC_SUCCESS) {\n",
			proc->proc_name,
			stringfix(proc->args.decls->decl.type),
			(newstyle ? "&" : ""),
			(newstyle ? proc->args.decls->decl.name : "argp"),
			stringfix(proc->res_type), ampr(proc->res_type), RESULT);
	}
	f_print(fout, "\t\treturn (NULL);\n");
	f_print(fout, "\t}\n");
	if (streq(proc->res_type, "void")) {
		f_print(fout, "\treturn ((void *)%s%s);\n",
			ampr(proc->res_type), RESULT);
	} else {
		f_print(fout, "\treturn (%s%s);\n", ampr(proc->res_type), RESULT);
	}
}
开发者ID:ANFS,项目名称:ANFS-utils,代码行数:60,代码来源:rpc_clntout.c


示例5: fsopen

static void
fsopen(Req *r)
{
	int rc;
	FInfo fi;
	Aux *a = r->fid->aux;

	a->end = a->off = 0;
	a->cache = emalloc9p(max(Sess->mtu, MTU));

	if(ptype(r->fid->qid.path) == Pinfo){
		if(makeinfo(pindex(r->fid->qid.path)) != -1)
			respond(r, nil);
		else
			respond(r, "cannot generate info");
		return;
	}

	if(r->fid->qid.type & QTDIR){
		respond(r, nil);
		return;
	}

	if(Sess->caps & CAP_NT_SMBS)
		rc = ntcreateopen(a, mapfile(a->path), r->ifcall.mode, 0777,
			0, 0, &fi);
	else
		rc = smbcreateopen(a, mapfile(a->path), r->ifcall.mode, 0777,
			0, 0, &fi);
	if(rc == -1){
		responderrstr(r);
		return;
	}
	respond(r, nil);
}
开发者ID:Nurb432,项目名称:plan9front,代码行数:35,代码来源:main.c


示例6: pprocdef

void
pprocdef(proc_list *proc, version_list *vp, 
	 const char *addargtype, int server_p, int mode)
{




		ptype( proc->res_prefix, proc->res_type, 1 );
		f_print( fout, "* " );
		if( server_p )
			pvname_svc(proc->proc_name, vp->vers_num);
		else
			pvname(proc->proc_name, vp->vers_num);

		/*
		 * mode  0 == cplusplus, mode  1 = ANSI-C, mode 2 = old style C 
		 */
		if(mode == 0 || mode ==1) 
			parglist(proc, addargtype);
		else
			f_print(fout, "();\n");



}
开发者ID:libogdi,项目名称:ogdi,代码行数:26,代码来源:rpc_hout.c


示例7: fsdestroyfid

static void
fsdestroyfid(Fid *f)
{
	Aux *a = f->aux;

	if(ptype(f->qid.path) == Pinfo)
		freeinfo(pindex(f->qid.path));
	f->omode = -1;
	if(! a)
		return;
	if(a->fh != -1)
		if(CIFSclose(Sess, a->sp, a->fh) == -1)
			fprint(2, "%s: close failed fh=%d %r\n", argv0, a->fh);
	if(a->sh != -1)
		if(CIFSfindclose2(Sess, a->sp, a->sh) == -1)
			fprint(2, "%s: findclose failed sh=%d %r\n",
				argv0, a->sh);
	if(a->path)
		free(a->path);
	if(a->cache)
		free(a->cache);

	if(a == Auxroot)
		Auxroot = a->next;
	a->prev->next = a->next;
	a->next->prev = a->prev;
	if(a->next == a->prev)
		Auxroot = nil;
	if(a)
		free(a);
}
开发者ID:Nurb432,项目名称:plan9front,代码行数:31,代码来源:main.c


示例8: write_program

static void
write_program(definition *def)
{
	version_list *vp;
	proc_list *proc;

	for (vp = def->def.pr.versions; vp != NULL; vp = vp->next) {
		for (proc = vp->procs; proc != NULL; proc = proc->next) {
			f_print(fout, "\n");
			if (mtflag == 0) {
				ptype(proc->res_prefix, proc->res_type, 1);
				f_print(fout, "*\n");
				pvname(proc->proc_name, vp->vers_num);
				printarglist(proc, RESULT, "clnt", "CLIENT *");
			} else {
				f_print(fout, "enum clnt_stat \n");
				pvname(proc->proc_name, vp->vers_num);
				printarglist(proc, RESULT,  "clnt", "CLIENT *");

			}
			f_print(fout, "{\n");
			printbody(proc);

			f_print(fout, "}\n");
		}
	}
}
开发者ID:edgar-pek,项目名称:PerspicuOS,代码行数:27,代码来源:rpc_clntout.c


示例9: pprocdef

void
pprocdef (proc_list * proc, version_list * vp,
	  const char *addargtype, int server_p, int mode)
{
  if (mtflag)
    {/* Print MT style stubs */
      if (server_p)
	f_print (fout, "bool_t ");
      else
	f_print (fout, "enum clnt_stat ");
    }
  else
    {
      ptype (proc->res_prefix, proc->res_type, 1);
      f_print (fout, "* ");
    }
  if (server_p)
    pvname_svc (proc->proc_name, vp->vers_num);
  else
    pvname (proc->proc_name, vp->vers_num);

  /*
   * mode  1 = ANSI-C, mode 2 = K&R C
   */
  if (mode == 1)
    parglist (proc, addargtype);
  else
    f_print (fout, "();\n");
}
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.toolchain,代码行数:29,代码来源:rpc_hout.c


示例10: printit

static void
printit (char *prefix, char *type)
{
  int len;
  int tabs;


  len = fprintf (fout, "\t(xdrproc_t) xdr_%s,", stringfix (type));
  /* account for leading tab expansion */
  len += TABSIZE - 1;
  /* round up to tabs required */
  tabs = (TABSTOP - len + TABSIZE - 1) / TABSIZE;
  f_print (fout, "%s", &tabstr[TABCOUNT - tabs]);

  if (streq (type, "void")) {
    f_print (fout, "0");
  }
  else {
    f_print (fout, "sizeof ( ");
    /* XXX: should "follow" be 1 ??? */
    ptype (prefix, type, 0);
    f_print (fout, ")");
  }
  f_print (fout, ",\n");
}
开发者ID:Sidnicious,项目名称:sfslite,代码行数:25,代码来源:rpc_tblout.c


示例11: printbody

static void
printbody(proc_list *proc)
{
	f_print(fout, "\tstatic ");
	if (streq(proc->res_type, "void")) {
		f_print(fout, "char ");
	} else {
		ptype(proc->res_prefix, proc->res_type, 0);
	}
	f_print(fout, "res;\n");
	f_print(fout, "\n");
 	f_print(fout, "\tbzero((char *)%sres, sizeof(res));\n",
 		ampr(proc->res_type));
	f_print(fout,
		"\tif (clnt_call(clnt, %s, xdr_%s, argp, xdr_%s, %sres, TIMEOUT) != RPC_SUCCESS) {\n",
		proc->proc_name, stringfix(proc->arg_type),
		stringfix(proc->res_type), ampr(proc->res_type));
	f_print(fout, "\t\treturn (NULL);\n");
	f_print(fout, "\t}\n");
	if (streq(proc->res_type, "void")) {
		f_print(fout, "\treturn ((void *)%sres);\n",
			ampr(proc->res_type));
	} else {
		f_print(fout, "\treturn (%sres);\n", ampr(proc->res_type));
	}
}
开发者ID:ManfredHerrmann,项目名称:proview,代码行数:26,代码来源:pdr_clnt.c


示例12: printarglist

void
printarglist(proc_list *proc, char *addargname, char *addargtype)
{

	decl_list      *l;

	if (!newstyle) {	/* old style: always pass arg by reference */
		if (Cflag) {	/* C++ style heading */
			f_print(fout, "(");
			ptype(proc->args.decls->decl.prefix, proc->args.decls->decl.type, 1);
			f_print(fout, "*argp, %s%s)\n", addargtype, addargname);
		} else {
			f_print(fout, "(argp, %s)\n", addargname);
			f_print(fout, "\t");
			ptype(proc->args.decls->decl.prefix, proc->args.decls->decl.type, 1);
			f_print(fout, "*argp;\n");
		}
	} else if (streq(proc->args.decls->decl.type, "void")) {
		/* newstyle, 0 argument */
		if (Cflag)
			f_print(fout, "(%s%s)\n", addargtype, addargname);
		else
			f_print(fout, "(%s)\n", addargname);
	} else {
		/* new style, 1 or multiple arguments */
		if (!Cflag) {
			f_print(fout, "(");
			for (l = proc->args.decls; l != NULL; l = l->next)
				f_print(fout, "%s, ", l->decl.name);
			f_print(fout, "%s)\n", addargname);
			for (l = proc->args.decls; l != NULL; l = l->next) {
				pdeclaration(proc->args.argname, &l->decl, 1, ";\n");
			}
		} else {	/* C++ style header */
			f_print(fout, "(");
			for (l = proc->args.decls; l != NULL; l = l->next) {
				pdeclaration(proc->args.argname, &l->decl, 0, ", ");
			}
			f_print(fout, " %s%s)\n", addargtype, addargname);
		}
	}

	if (!Cflag)
		f_print(fout, "\t%s%s;\n", addargtype, addargname);
}
开发者ID:ANFS,项目名称:ANFS-utils,代码行数:45,代码来源:rpc_clntout.c


示例13: printarglist

void
printarglist(proc_list *proc, const char *result, const char *addargname,
    const char *addargtype)
{

	decl_list *l;

	if (!newstyle) {
		/* old style: always pass argument by reference */
		f_print(fout, "(");
		ptype(proc->args.decls->decl.prefix,
		      proc->args.decls->decl.type, 1);

		if (mtflag) {/* Generate result field */
			f_print(fout, "*argp, ");
			ptype(proc->res_prefix, proc->res_type, 1);
			f_print(fout, "*%s, %s%s)\n",
				result, addargtype, addargname);
		} else
			f_print(fout, "*argp, %s%s)\n", addargtype, addargname);
	} else if (streq(proc->args.decls->decl.type, "void")) {
		/* newstyle, 0 argument */
		if (mtflag) {
			f_print(fout, "(");
			ptype(proc->res_prefix, proc->res_type, 1);
			f_print(fout, "*%s, %s%s)\n",
				result, addargtype, addargname);
		} else
			f_print(fout, "(%s%s)\n", addargtype, addargname);
	} else {
		/* new style, 1 or multiple arguments */
		f_print(fout, "(");
		for (l = proc->args.decls; l != NULL; l = l->next) {
			pdeclaration(proc->args.argname, &l->decl, 0, ", ");
		}
		if (mtflag) {
			ptype(proc->res_prefix, proc->res_type, 1);
			f_print(fout, "*%s, ", result);

		}
		f_print(fout, "%s%s)\n", addargtype, addargname);
	}
}
开发者ID:edgar-pek,项目名称:PerspicuOS,代码行数:43,代码来源:rpc_clntout.c


示例14: get_type

const TypeData *TypeData::const_read_at (const Key &key) const {
  if (ptype() == tp_var) {
    return get_type (tp_var);
  }
  if (!structured()) {
    return get_type (tp_Unknown);
  }
  TypeData *res = at (key);
  if (res == NULL) {
    return get_type (tp_Unknown);
  }
  return res;
}
开发者ID:AbramovVitaliy,项目名称:kphp-kdb,代码行数:13,代码来源:types.cpp


示例15: write_program

static void
write_program(definition * def)
{
    version_list *vp;
    proc_list *proc;

    for (vp = def->def.pr.versions; vp != NULL; vp = vp->next) {
	for (proc = vp->procs; proc != NULL; proc = proc->next) {
	    f_print(fout, "\n");
	    ptype(proc->res_prefix, proc->res_type, 1);
	    f_print(fout, "*\n");
	    pvname(proc->proc_name, vp->vers_num);
	    f_print(fout, "(argp, clnt)\n");
	    f_print(fout, "\t");
	    ptype(proc->arg_prefix, proc->arg_type, 1);
	    f_print(fout, "*argp;\n");
	    f_print(fout, "\tCLIENT *clnt;\n");
	    f_print(fout, "{\n");
	    printbody(proc);
	    f_print(fout, "}\n\n");
	}
    }
}
开发者ID:SimonWilkinson,项目名称:openafs,代码行数:23,代码来源:rpc_clntout.c


示例16: ptype

//**********************************************************************************************************************
vector<string> MakeFileCommand::setParameters(){
    try {
        CommandParameter ptype("type", "Multiple", "fastq-gz", "fastq", "", "", "","",false,false); parameters.push_back(ptype);
        CommandParameter pnumcols("numcols", "Multiple", "2-3", "3", "", "", "","",false,false, true); parameters.push_back(pnumcols);
        CommandParameter pseed("seed", "Number", "", "0", "", "", "","",false,false); parameters.push_back(pseed);
        CommandParameter pinputdir("inputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(pinputdir);
        CommandParameter poutputdir("outputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(poutputdir);
        
        vector<string> myArray;
        for (int i = 0; i < parameters.size(); i++) {	myArray.push_back(parameters[i].name);		}
        return myArray;
    }
    catch(exception& e) {
        m->errorOut(e, "MakeFileCommand", "setParameters");
        exit(1);
    }
}
开发者ID:YuJinhui,项目名称:mothur,代码行数:18,代码来源:makefilecommand.cpp


示例17: add_new_pages

static void
add_new_pages(FILE *temp_db, FILE *new_file, char *addname, char *fullname)
{
    char type[15];
    int pos;
    int present_type;
    int pages = 0;
    struct stat fstats;

    stat(fullname, &fstats);
    fprintf(temp_db, "\t%s %d\n", addname, (int)fstats.st_mtime);
    cfile = new_file;
    init_scanner();
    while (get_token() != EOF) {
        if (Special(token.type)) {
            ptype(type, token.id);
            present_type = token.type;
            pos = keyword_fpos;
            get_token();
            if (token.type != Lbrace) {
                fprintf(stderr, "missing left brace after a page, macro or patch \
                         declaration\n");
                fprintf(stderr, "In the file %s on line %d\n", fullname, line_number);
                exit(-1);
            }
            get_token();
            if (present_type == Page && token.type != Word) {
                fprintf(stderr, "missing page name after \\begin{page}\n");
                fprintf(stderr, "In the file %s on line %d\n", fullname, line_number);
                exit(-1);
            }
            else if (present_type == Macro && token.type != Macro) {
                fprintf(stderr, "Expected a \\macro name after newcommand, got %s\n",
                        token.id);
                fprintf(stderr, "In the file %s on line %d\n", fullname, line_number);
                exit(-1);
            }
            else if (present_type == Patch && token.type != Word) {
                fprintf(stderr, "Missing patch name after a \\begin{patch}\n");
                fprintf(stderr, "In the file %s on line %d\n", fullname, line_number);
                exit(-1);
            }
            fprintf(temp_db, "\\%s %s %d %d\n", type,
                    token.id, pos, line_number);
            pages++;
        }
开发者ID:acralfs,项目名称:fricas,代码行数:46,代码来源:htadd.c


示例18: fsread

static void
fsread(Req *r)
{
	vlong n, m, got;
	Aux *a = r->fid->aux;
	char *buf = r->ofcall.data;
	vlong len = r->ifcall.count;
	vlong off = r->ifcall.offset;

	if(ptype(r->fid->qid.path) == Pinfo){
		r->ofcall.count = readinfo(pindex(r->fid->qid.path), buf, len,
			off);
		respond(r, nil);
		return;
	}

	if(r->fid->qid.type & QTDIR){
		dirread9p(r, dirgen, a);
		respond(r, nil);
		return;
	}

	got = 0;
	n = Sess->mtu -OVERHEAD;
	do{
		if(len - got < n)
			n = len - got;
		m = CIFSread(Sess, a->sp, a->fh, off + got, buf + got, n, len);
		if(m != -1)
			got += m;
	} while(got < len && m >= n);

	r->ofcall.count = got;
	if(m == -1)
		responderrstr(r);
	else
		respond(r, nil);
}
开发者ID:Nurb432,项目名称:plan9front,代码行数:38,代码来源:main.c


示例19: addDefaultArguments

static QByteArray addDefaultArguments(const QByteArray &prototype, int numDefArgs)
{
    // nothing to do, or unsupported anyway
    if (!numDefArgs || prototype.contains("/**"))
        return prototype;

    QByteArray ptype(prototype);
    int in = -1;
    while (numDefArgs) {
        in = ptype.lastIndexOf(']', in);
        ptype.replace(in, 1, ",optional]");
        in = ptype.indexOf(' ', in) + 1;
        QByteArray type = ptype.mid(in, ptype.indexOf(' ', in) - in);
        if (type == "enum")
            type += ' ' + ptype.mid(in + 5, ptype.indexOf(' ', in + 5) - in - 5);
        if (type == "struct")
            type += ' ' + ptype.mid(in + 7, ptype.indexOf(' ', in + 7) - in - 7);
        ptype.replace(in, type.length(), QByteArray("VARIANT /*was: ") + type + "*/");
        --numDefArgs;
    }

    return ptype;
}
开发者ID:RSATom,项目名称:Qt,代码行数:23,代码来源:qaxserver.cpp


示例20: if

//------------------------------------------------------------------------------
void WBPageSetup::propagate_print_settings_to_grt_tree()
{
  std::string page_orientation_as_str;
  
  // Set orientation
  Gtk::PageOrientation page_orient = _page_setup->get_orientation();
  if ( page_orient == Gtk::PAGE_ORIENTATION_PORTRAIT )
    page_orientation_as_str = "portrait";
  else if ( page_orient == Gtk::PAGE_ORIENTATION_LANDSCAPE )
    page_orientation_as_str = "landscape";
  else
  {
    g_message("Unsupported page orientation. Setting page orientation to portrait");
    page_orientation_as_str = "portrait";
  }  
  _app_page_settings->orientation(page_orientation_as_str);
  
  // Set paper type
  Gtk::PaperSize   gtk_paper_size      = _page_setup->get_paper_size();
  app_PaperTypeRef paper_type          = _app_page_settings->paperType();

  const std::string paper_name = bec::replace_string(gtk_paper_size_get_name(gtk_paper_size.gobj()), "_", "-");

  grt::ListRef<app_PaperType> paper_types(grt::ListRef<app_PaperType>::cast_from(_app_page_settings.get_grt()->get("/wb/options/paperTypes")));
  
  app_PaperTypeRef ptype(app_PaperTypeRef::cast_from(grt::find_named_object_in_list(paper_types, paper_name)));

  _app_page_settings->marginBottom(gtk_paper_size.get_default_bottom_margin(Gtk::UNIT_MM));
  _app_page_settings->marginLeft(gtk_paper_size.get_default_left_margin(Gtk::UNIT_MM));
  _app_page_settings->marginRight(gtk_paper_size.get_default_right_margin(Gtk::UNIT_MM));
  _app_page_settings->marginTop(gtk_paper_size.get_default_top_margin(Gtk::UNIT_MM));

  if (ptype.is_valid())
    _app_page_settings->paperType(ptype);
  else
    g_warning("Unknown paper size selected in GTK Page Setup dialog: %s", paper_name.c_str());
}
开发者ID:abibell,项目名称:mysql-workbench,代码行数:38,代码来源:wb_printing_linux.cpp



注:本文中的ptype函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ publish函数代码示例发布时间:2022-05-30
下一篇:
C++ ptu_uint_eq函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap