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

C++ recalculate_sizes函数代码示例

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

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



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

示例1: cmd_move_window_exec

enum cmd_retval
cmd_move_window_exec(struct cmd *self, struct cmd_q *cmdq)
{
#ifdef TMATE
	cmdq_error(cmdq, "move window is not supported with tmate");
	return (CMD_RETURN_ERROR);
#else
	struct args	*args = self->args;
	struct session	*src = cmdq->state.sflag.s;
	struct session	*dst = cmdq->state.tflag.s;
	struct winlink	*wl = cmdq->state.sflag.wl;
	char		*cause;
	int		 idx = cmdq->state.tflag.idx, kflag, dflag, sflag;

	kflag = args_has(self->args, 'k');
	dflag = args_has(self->args, 'd');

	if (args_has(args, 'r')) {
		session_renumber_windows(dst);
		recalculate_sizes();

		return (CMD_RETURN_NORMAL);
	}

	kflag = args_has(self->args, 'k');
	dflag = args_has(self->args, 'd');
	sflag = args_has(self->args, 's');

	if (args_has(self->args, 'a')) {
		if ((idx = winlink_shuffle_up(dst, dst->curw)) == -1)
			return (CMD_RETURN_ERROR);
	}

	if (server_link_window(src, wl, dst, idx, kflag, !dflag,
	    &cause) != 0) {
		cmdq_error(cmdq, "can't link window: %s", cause);
		free(cause);
		return (CMD_RETURN_ERROR);
	}
	if (self->entry == &cmd_move_window_entry)
		server_unlink_window(src, wl);

	/*
	 * Renumber the winlinks in the src session only, the destination
	 * session already has the correct winlink id to us, either
	 * automatically or specified by -s.
	 */
	if (!sflag && options_get_number(src->options, "renumber-windows"))
		session_renumber_windows(src);

	recalculate_sizes();

	return (CMD_RETURN_NORMAL);
#endif
}
开发者ID:CadeLaRen,项目名称:tmate,代码行数:55,代码来源:cmd-move-window.c


示例2: cmd_link_window_exec

enum cmd_retval
cmd_link_window_exec(struct cmd *self, struct cmd_q *cmdq)
{
	struct args	*args = self->args;
	struct session	*src, *dst;
	struct winlink	*wl;
	char		*cause;
	int		 idx, kflag, dflag;

	if ((wl = cmd_find_window(cmdq, args_get(args, 's'), &src)) == NULL)
		return (CMD_RETURN_ERROR);
	if ((idx = cmd_find_index(cmdq, args_get(args, 't'), &dst)) == -2)
		return (CMD_RETURN_ERROR);

	kflag = args_has(self->args, 'k');
	dflag = args_has(self->args, 'd');
	if (server_link_window(src, wl, dst, idx, kflag, !dflag, &cause) != 0) {
		cmdq_error(cmdq, "can't link window: %s", cause);
		free(cause);
		return (CMD_RETURN_ERROR);
	}
	recalculate_sizes();

	return (CMD_RETURN_NORMAL);
}
开发者ID:Axylos,项目名称:dots,代码行数:25,代码来源:cmd-link-window.c


示例3: cmd_unlink_window_exec

int
cmd_unlink_window_exec(struct cmd *self, struct cmd_ctx *ctx)
{
	struct args		*args = self->args;
	struct winlink		*wl;
	struct window		*w;
	struct session		*s, *s2;
	struct session_group	*sg;
	u_int			 references;

	if ((wl = cmd_find_window(ctx, args_get(args, 't'), &s)) == NULL)
		return (-1);
	w = wl->window;

	sg = session_group_find(s);
	if (sg != NULL) {
		references = 0;
		TAILQ_FOREACH(s2, &sg->sessions, gentry)
			references++;
	} else
		references = 1;

	if (!args_has(self->args, 'k') && w->references == references) {
		ctx->error(ctx, "window is only linked to one session");
		return (-1);
	}

	server_unlink_window(s, wl);
	recalculate_sizes();

	return (0);
}
开发者ID:psych0tik,项目名称:tmux,代码行数:32,代码来源:cmd-unlink-window.c


示例4: handle_resize

static void handle_resize(struct tmate_session *session,
			  struct tmate_unpacker *uk)
{
	session->min_sx = unpack_int(uk);
	session->min_sy = unpack_int(uk);
	recalculate_sizes();
}
开发者ID:CadeLaRen,项目名称:tmate,代码行数:7,代码来源:tmate-decoder.c


示例5: cmd_swap_window_exec

int
cmd_swap_window_exec(struct cmd *self, struct cmd_ctx *ctx)
{
	struct cmd_srcdst_data	*data = self->data;
	struct session		*src, *dst;
	struct winlink		*wl_src, *wl_dst;
	struct window		*w;

	if ((wl_src = cmd_find_window(ctx, data->src, &src)) == NULL)
		return (-1);
	if ((wl_dst = cmd_find_window(ctx, data->dst, &dst)) == NULL)
		return (-1);

	if (wl_dst->window == wl_src->window)
		return (0);

	w = wl_dst->window;
	wl_dst->window = wl_src->window;
	wl_src->window = w;

	if (!(data->chflags & CMD_CHFLAG('d'))) {
		session_select(dst, wl_dst->idx);
		if (src != dst)
			session_select(src, wl_src->idx);
	}
	server_redraw_session(src);
	if (src != dst)
		server_redraw_session(dst);
	recalculate_sizes();

	return (0);
}
开发者ID:ThomasAdam,项目名称:tmux-ARCHIVED,代码行数:32,代码来源:cmd-swap-window.c


示例6: cmd_kill_pane_exec

int
cmd_kill_pane_exec(struct cmd *self, struct cmd_ctx *ctx)
{
	struct args		*args = self->args;
	struct winlink		*wl;
	struct window_pane	*loopwp, *nextwp, *wp;

	if ((wl = cmd_find_pane(ctx, args_get(args, 't'), NULL, &wp)) == NULL)
		return (-1);

	if (window_count_panes(wl->window) == 1) {
		/* Only one pane, kill the window. */
		server_kill_window(wl->window);
		recalculate_sizes();
		return (0);
	}

	if (args_has(self->args, 'a')) {
		loopwp = TAILQ_FIRST(&wl->window->panes);
		while (loopwp != NULL) {
			nextwp = TAILQ_NEXT(loopwp, entry);
			if (loopwp != wp) {
				layout_close_pane(loopwp);
				window_remove_pane(wl->window, loopwp);
			}
			loopwp = nextwp;
		}
	} else {
		layout_close_pane(wp);
		window_remove_pane(wl->window, wp);
	}
	server_redraw_window(wl->window);

	return (0);
}
开发者ID:psych0tik,项目名称:tmux,代码行数:35,代码来源:cmd-kill-pane.c


示例7: cmd_move_window_exec

int
cmd_move_window_exec(struct cmd *self, struct cmd_ctx *ctx)
{
	struct cmd_srcdst_data	*data = self->data;
	struct session		*src, *dst;
	struct winlink		*wl;
	char			*cause;
	int			 idx, kflag, dflag;

	if ((wl = cmd_find_window(ctx, data->src, &src)) == NULL)
		return (-1);
	if ((idx = cmd_find_index(ctx, data->dst, &dst)) == -2)
		return (-1);

	kflag = cmd_check_flag(data->chflags, 'k');
	dflag = cmd_check_flag(data->chflags, 'd');
	if (server_link_window(src, wl, dst, idx, kflag, !dflag, &cause) != 0) {
		ctx->error(ctx, "can't move window: %s", cause);
		xfree(cause);
		return (-1);
	}
	server_unlink_window(src, wl);
	recalculate_sizes();

	return (0);
}
开发者ID:ddollar,项目名称:tmux,代码行数:26,代码来源:cmd-move-window.c


示例8: cmd_select_prompt_callback

int
cmd_select_prompt_callback(void *data, const char *s)
{
    struct client	*c = data;
    const char	*errstr;
    char		 msg[128];
    u_int		 idx;

    if (s == NULL || *s == '\0')
        return (0);

    idx = strtonum(s, 0, UINT_MAX, &errstr);
    if (errstr != NULL) {
        xsnprintf(msg, sizeof msg, "Index %s: %s", errstr, s);
        status_message_set(c, "%s", msg);
        return (0);
    }

    if (winlink_find_by_index(&c->session->windows, idx) == NULL) {
        xsnprintf(msg, sizeof msg,
                  "Window not found: %s:%d", c->session->name, idx);
        status_message_set(c, "%s", msg);
        return (0);
    }

    if (session_select(c->session, idx) == 0)
        server_redraw_session(c->session);
    recalculate_sizes();

    return (0);
}
开发者ID:dsturnbull,项目名称:tmux,代码行数:31,代码来源:cmd-select-prompt.c


示例9: cmd_move_window_exec

int
cmd_move_window_exec(struct cmd *self, struct cmd_ctx *ctx)
{
	struct args	*args = self->args;
	struct session	*src, *dst;
	struct winlink	*wl;
	char		*cause;
	int		 idx, kflag, dflag;

	if ((wl = cmd_find_window(ctx, args_get(args, 's'), &src)) == NULL)
		return (-1);
	if ((idx = cmd_find_index(ctx, args_get(args, 't'), &dst)) == -2)
		return (-1);

	kflag = args_has(self->args, 'k');
	dflag = args_has(self->args, 'd');
	if (server_link_window(src, wl, dst, idx, kflag, !dflag, &cause) != 0) {
		ctx->error(ctx, "can't move window: %s", cause);
		xfree(cause);
		return (-1);
	}
	server_unlink_window(src, wl);
	recalculate_sizes();

	return (0);
}
开发者ID:ThomasAdam,项目名称:tmux-ARCHIVED,代码行数:26,代码来源:cmd-move-window.c


示例10: cmd_switch_client_exec

int
cmd_switch_client_exec(struct cmd *self, struct cmd_ctx *ctx)
{
	struct cmd_switch_client_data	*data = self->data;
	struct client			*c;
	struct session			*s;

	if (data == NULL)
		return (0);

	if ((c = cmd_find_client(ctx, data->name)) == NULL)
		return (-1);

	if (data->flag_next) {
		if ((s = session_next_session(c->session)) == NULL) {
			ctx->error(ctx, "can't find next session");
			return (-1);
		}
	} else if (data->flag_previous) {
		if ((s = session_previous_session(c->session)) == NULL) {
			ctx->error(ctx, "can't find previous session");
			return (-1);
		}
	} else
		s = cmd_find_session(ctx, data->target);

	if (s == NULL)
		return (-1);
	c->session = s;

	recalculate_sizes();
	server_redraw_client(c);

	return (0);
}
开发者ID:ronin13,项目名称:Tmux,代码行数:35,代码来源:cmd-switch-client.c


示例11: cmd_lock_server_exec

/* ARGSUSED */
int
cmd_lock_server_exec(unused struct cmd *self, unused struct cmd_ctx *ctx)
{
	server_lock();
	recalculate_sizes();

	return (0);
}
开发者ID:ddollar,项目名称:tmux,代码行数:9,代码来源:cmd-lock-server.c


示例12: tmate_client_resize

static void tmate_client_resize(struct tmate_unpacker *uk)
{
	/* TODO This is sad, we might want our own client. */
	tmate_sx = unpack_int(uk);
	tmate_sy = unpack_int(uk);
	recalculate_sizes();

	/* TODO Handle reconnection cases */
}
开发者ID:alejom200,项目名称:tmate,代码行数:9,代码来源:tmate-decoder.c


示例13: recalculate_sizes

void vsx_widget_checkbox::i_draw()
{
  recalculate_sizes();
  draw_box_gradient(
        get_pos_p() - vsx_vector3f(size.x * 0.5f, size.y * 0.5f),
        size.x, size.y,
        vsx_widget_skin::get_instance()->get_color(1), vsx_widget_skin::get_instance()->get_color(1),
        vsx_widget_skin::get_instance()->get_color(1), vsx_widget_skin::get_instance()->get_color(1)
        );
}
开发者ID:vovoid,项目名称:vsxu,代码行数:10,代码来源:vsx_widget_checkbox.cpp


示例14: cmd_switch_client_exec

int
cmd_switch_client_exec(struct cmd *self, struct cmd_ctx *ctx)
{
	struct args	*args = self->args;
	struct client	*c;
	struct session	*s;

	if ((c = cmd_find_client(ctx, args_get(args, 'c'))) == NULL)
		return (-1);

	if (args_has(args, 'r')) {
		if (c->flags & CLIENT_READONLY) {
			c->flags &= ~CLIENT_READONLY;
			ctx->info(ctx, "made client writable");
		} else {
			c->flags |= CLIENT_READONLY;
			ctx->info(ctx, "made client read-only");
		}
	}

	s = NULL;
	if (args_has(args, 'n')) {
		if ((s = session_next_session(c->session)) == NULL) {
			ctx->error(ctx, "can't find next session");
			return (-1);
		}
	} else if (args_has(args, 'p')) {
		if ((s = session_previous_session(c->session)) == NULL) {
			ctx->error(ctx, "can't find previous session");
			return (-1);
		}
	} else if (args_has(args, 'l')) {
		if (c->last_session != NULL && session_alive(c->last_session))
			s = c->last_session;
		if (s == NULL) {
			ctx->error(ctx, "can't find last session");
			return (-1);
		}
	} else
		s = cmd_find_session(ctx, args_get(args, 't'), 0);
	if (s == NULL)
		return (-1);

	if (c->session != NULL)
		c->last_session = c->session;
	c->session = s;
	session_update_activity(s);

	recalculate_sizes();
	server_check_unattached();
	server_redraw_client(c);
	s->curw->flags &= ~WINLINK_ALERTFLAGS;

	return (0);
}
开发者ID:ThomasAdam,项目名称:tmux-ARCHIVED,代码行数:55,代码来源:cmd-switch-client.c


示例15: cmd_select_window_exec

enum cmd_retval
cmd_select_window_exec(struct cmd *self, struct cmd_q *cmdq)
{
	struct winlink	*wl = cmdq->state.tflag.wl;
	struct session	*s = cmdq->state.tflag.s;
	int		 next, previous, last, activity;

	next = self->entry == &cmd_next_window_entry;
	if (args_has(self->args, 'n'))
		next = 1;
	previous = self->entry == &cmd_previous_window_entry;
	if (args_has(self->args, 'p'))
		previous = 1;
	last = self->entry == &cmd_last_window_entry;
	if (args_has(self->args, 'l'))
		last = 1;

	if (next || previous || last) {
		activity = args_has(self->args, 'a');
		if (next) {
			if (session_next(s, activity) != 0) {
				cmdq_error(cmdq, "no next window");
				return (CMD_RETURN_ERROR);
			}
		} else if (previous) {
			if (session_previous(s, activity) != 0) {
				cmdq_error(cmdq, "no previous window");
				return (CMD_RETURN_ERROR);
			}
		} else {
			if (session_last(s) != 0) {
				cmdq_error(cmdq, "no last window");
				return (CMD_RETURN_ERROR);
			}
		}

		server_redraw_session(s);
	} else {
		/*
		 * If -T and select-window is invoked on same window as
		 * current, switch to previous window.
		 */
		if (args_has(self->args, 'T') && wl == s->curw) {
			if (session_last(s) != 0) {
				cmdq_error(cmdq, "no last window");
				return (-1);
			}
			server_redraw_session(s);
		} else if (session_select(s, wl->idx) == 0)
			server_redraw_session(s);
	}
	recalculate_sizes();

	return (CMD_RETURN_NORMAL);
}
开发者ID:20400992,项目名称:tmux,代码行数:55,代码来源:cmd-select-window.c


示例16: cmd_select_window_exec

int
cmd_select_window_exec(struct cmd *self, struct cmd_ctx *ctx)
{
	struct args	*args = self->args;
	struct winlink	*wl;
	struct session	*s;
	int		 next, previous, last, activity;

	next = self->entry == &cmd_next_window_entry;
	if (args_has(self->args, 'n'))
		next = 1;
	previous = self->entry == &cmd_previous_window_entry;
	if (args_has(self->args, 'p'))
		previous = 1;
	last = self->entry == &cmd_last_window_entry;
	if (args_has(self->args, 'l'))
		last = 1;

	if (next || previous || last) {
		s = cmd_find_session(ctx, args_get(args, 't'), 0);
		if (s == NULL)
			return (-1);

		activity = args_has(self->args, 'a');
		if (next) {
			if (session_next(s, activity) != 0) {
				ctx->error(ctx, "no next window");
				return (-1);
			}
		} else if (previous) {
			if (session_previous(s, activity) != 0) {
				ctx->error(ctx, "no previous window");
				return (-1);
			}
		} else {
			if (session_last(s) != 0) {
				ctx->error(ctx, "no last window");
				return (-1);
			}
		}

		server_redraw_session(s);
	} else {
		wl = cmd_find_window(ctx, args_get(args, 't'), &s);
		if (wl == NULL)
			return (-1);

		if (session_select(s, wl->idx) == 0)
			server_redraw_session(s);
	}
	recalculate_sizes();

	return (0);
}
开发者ID:ThomasAdam,项目名称:tmux-ARCHIVED,代码行数:54,代码来源:cmd-select-window.c


示例17: cmd_lock_client_exec

int
cmd_lock_client_exec(struct cmd *self, struct cmd_ctx *ctx)
{
	struct cmd_target_data	*data = self->data;
	struct client		*c;

	if ((c = cmd_find_client(ctx, data->target)) == NULL)
		return (-1);

	server_lock_client(c);
	recalculate_sizes();

	return (0);
}
开发者ID:ThomasAdam,项目名称:tmux-ARCHIVED,代码行数:14,代码来源:cmd-lock-client.c


示例18: cmd_lock_server_exec

static enum cmd_retval
cmd_lock_server_exec(struct cmd *self, __unused struct cmd_q *cmdq)
{
	if (self->entry == &cmd_lock_server_entry)
		server_lock();
	else if (self->entry == &cmd_lock_session_entry)
		server_lock_session(cmdq->state.tflag.s);
	else
		server_lock_client(cmdq->state.c);

	recalculate_sizes();

	return (CMD_RETURN_NORMAL);
}
开发者ID:east11210,项目名称:tmux,代码行数:14,代码来源:cmd-lock-server.c


示例19: cmd_kill_window_exec

int
cmd_kill_window_exec(struct cmd *self, struct cmd_ctx *ctx)
{
	struct args	*args = self->args;
	struct winlink	*wl;

	if ((wl = cmd_find_window(ctx, args_get(args, 't'), NULL)) == NULL)
		return (-1);

	server_kill_window(wl->window);
	recalculate_sizes();

	return (0);
}
开发者ID:ThomasAdam,项目名称:tmux-ARCHIVED,代码行数:14,代码来源:cmd-kill-window.c


示例20: cmd_lock_session_exec

int
cmd_lock_session_exec(struct cmd *self, struct cmd_ctx *ctx)
{
	struct cmd_target_data	*data = self->data;
	struct session		*s;

	if ((s = cmd_find_session(ctx, data->target)) == NULL)
		return (-1);

	server_lock_session(s);
	recalculate_sizes();

	return (0);
}
开发者ID:ddollar,项目名称:tmux,代码行数:14,代码来源:cmd-lock-session.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ receiveByte函数代码示例发布时间:2022-05-30
下一篇:
C++ recalculate函数代码示例发布时间: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