示例#1
0
int main(int argc, char *argv[]){
	gtk_init(&argc, &argv);
	game_init();
	layout_init();
	gtk_main();
	return 0;
}
示例#2
0
int
cmd_break_pane_exec(struct cmd *self, struct cmd_ctx *ctx)
{
    struct args		*args = self->args;
    struct winlink		*wl;
    struct session		*s;
    struct window_pane	*wp;
    struct window		*w;
    char			*name;
    char			*cause;
    int			 base_idx;
    struct client		*c;

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

    if (window_count_panes(wl->window) == 1) {
        ctx->error(ctx, "can't break with only one pane");
        return (-1);
    }

    w = wl->window;
    TAILQ_REMOVE(&w->panes, wp, entry);
    if (wp == w->active) {
        w->active = w->last;
        w->last = NULL;
        if (w->active == NULL) {
            w->active = TAILQ_PREV(wp, window_panes, entry);
            if (w->active == NULL)
                w->active = TAILQ_NEXT(wp, entry);
        }
    } else if (wp == w->last)
        w->last = NULL;
    layout_close_pane(wp);

    w = wp->window = window_create1(s->sx, s->sy);
    TAILQ_INSERT_HEAD(&w->panes, wp, entry);
    w->active = wp;
    name = default_window_name(w);
    window_set_name(w, name);
    xfree(name);
    layout_init(w);

    base_idx = options_get_number(&s->options, "base-index");
    wl = session_attach(s, w, -1 - base_idx, &cause); /* can't fail */
    if (!args_has(self->args, 'd'))
        session_select(s, wl->idx);

    server_redraw_session(s);
    server_status_session_group(s);

    /* Output the window ID for control clients. */
    c = cmd_find_client(ctx, NULL);
    if (c->flags & CLIENT_CONTROL) {
        ctx->print(ctx, "%d", w->id);
    }

    return (0);
}
示例#3
0
enum cmd_retval
cmd_break_pane_exec(struct cmd *self, struct cmd_q *cmdq)
{
	struct args		*args = self->args;
	struct winlink		*wl;
	struct session		*s;
	struct window_pane	*wp;
	struct window		*w;
	char			*name;
	char			*cause;
	int			 base_idx;
	struct client		*c;
	struct format_tree	*ft;
	const char		*template;
	char			*cp;

	if ((wl = cmd_find_pane(cmdq, args_get(args, 't'), &s, &wp)) == NULL)
		return (CMD_RETURN_ERROR);

	if (window_count_panes(wl->window) == 1) {
		cmdq_error(cmdq, "can't break with only one pane");
		return (CMD_RETURN_ERROR);
	}

	w = wl->window;
	server_unzoom_window(w);

	TAILQ_REMOVE(&w->panes, wp, entry);
	if (wp == w->active) {
		w->active = w->last;
		w->last = NULL;
		if (w->active == NULL) {
			w->active = TAILQ_PREV(wp, window_panes, entry);
			if (w->active == NULL)
				w->active = TAILQ_NEXT(wp, entry);
		}
	} else if (wp == w->last)
		w->last = NULL;
	layout_close_pane(wp);

	w = wp->window = window_create1(s->sx, s->sy);
	TAILQ_INSERT_HEAD(&w->panes, wp, entry);
	w->active = wp;
	name = default_window_name(w);
	window_set_name(w, name);
	free(name);
	layout_init(w, wp);

	base_idx = options_get_number(&s->options, "base-index");
	wl = session_attach(s, w, -1 - base_idx, &cause); /* can't fail */
	if (!args_has(self->args, 'd'))
		session_select(s, wl->idx);

	server_redraw_session(s);
	server_status_session_group(s);

	if (args_has(args, 'P')) {
		if ((template = args_get(args, 'F')) == NULL)
示例#4
0
enum cmd_retval
cmd_break_pane_exec(struct cmd *self, struct cmd_q *cmdq)
{
#ifdef TMATE_SLAVE
    return (CMD_RETURN_ERROR);
#else
    struct args		*args = self->args;
    struct winlink		*wl = cmdq->state.sflag.wl;
    struct session		*src_s = cmdq->state.sflag.s;
    struct session		*dst_s = cmdq->state.tflag.s;
    struct window_pane	*wp = cmdq->state.sflag.wp;
    struct window		*w = wl->window;
    char			*name;
    char			*cause;
    int			 idx = cmdq->state.tflag.idx;
    struct format_tree	*ft;
    const char		*template;
    char			*cp;

    if (idx != -1 && winlink_find_by_index(&dst_s->windows, idx) != NULL) {
        cmdq_error(cmdq, "index %d already in use", idx);
        return (CMD_RETURN_ERROR);
    }

    if (window_count_panes(w) == 1) {
        cmdq_error(cmdq, "can't break with only one pane");
        return (CMD_RETURN_ERROR);
    }
    server_unzoom_window(w);

    TAILQ_REMOVE(&w->panes, wp, entry);
    window_lost_pane(w, wp);
    layout_close_pane(wp);

    w = wp->window = window_create1(dst_s->sx, dst_s->sy);
    TAILQ_INSERT_HEAD(&w->panes, wp, entry);
    w->active = wp;
    name = default_window_name(w);
    window_set_name(w, name);
    free(name);
    layout_init(w, wp);
    wp->flags |= PANE_CHANGED;

    if (idx == -1)
        idx = -1 - options_get_number(dst_s->options, "base-index");
    wl = session_attach(dst_s, w, idx, &cause); /* can't fail */
    if (!args_has(self->args, 'd'))
        session_select(dst_s, wl->idx);

    server_redraw_session(src_s);
    if (src_s != dst_s)
        server_redraw_session(dst_s);
    server_status_session_group(src_s);
    if (src_s != dst_s)
        server_status_session_group(dst_s);

    if (args_has(args, 'P')) {
        if ((template = args_get(args, 'F')) == NULL)
/*
 * bootloader_init() - Initialization for bootloader
 *
 * INPUT
 *     none
 * OUTPUT
 *     none
 *
 */
static void bootloader_init(void)
{
    reset_rng();
    timer_init();
    usart_init();
    keepkey_leds_init();
    keepkey_button_init();
    storage_sector_init();
    display_hw_init();
    layout_init(display_canvas_init());
}
示例#6
0
/*
 * kk_board_init() - Initialize board
 *
 * INPUT
 *     none
 * OUTPUT
 *     none
 */
void kk_board_init(void)
{
    kk_timer_init();

//    keepkey_leds_init();
    led_func(CLR_GREEN_LED);
    led_func(CLR_RED_LED);

    kk_keepkey_button_init();
#ifndef EMULATOR
    svc_enable_interrupts();    // This enables the timer and button interrupts
#endif
    
    layout_init(display_canvas_init());
}
示例#7
0
文件: main.c 项目: kcirick/fusionwm
void setup(){
   // remove zombies on SIGCHLD
   sigchld(0);

   gScreen = DefaultScreen(gDisplay);
   gRoot = RootWindow(gDisplay, gScreen);
   XSelectInput(gDisplay, gRoot, ROOT_EVENT_MASK);

   // initialize subsystems
   inputs_init();
   clientlist_init();
   layout_init();
	systray_init();
   update_status();
}
示例#8
0
VALUE Message_alloc(VALUE klass) {
  VALUE descriptor = rb_iv_get(klass, kDescriptorInstanceVar);
  Descriptor* desc = ruby_to_Descriptor(descriptor);
  MessageHeader* msg = (MessageHeader*)ALLOC_N(
      uint8_t, sizeof(MessageHeader) + desc->layout->size);
  memset(Message_data(msg), 0, desc->layout->size);

  // We wrap first so that everything in the message object is GC-rooted in case
  // a collection happens during object creation in layout_init().
  VALUE ret = TypedData_Wrap_Struct(klass, &Message_type, msg);
  msg->descriptor = desc;
  rb_iv_set(ret, kDescriptorInstanceVar, descriptor);

  layout_init(desc->layout, Message_data(msg));

  return ret;
}
示例#9
0
static enum cmd_retval
cmd_break_pane_exec(struct cmd *self, struct cmdq_item *item)
{
	struct args		*args = self->args;
	struct cmd_find_state	*current = &item->shared->current;
	struct client		*c = cmd_find_client(item, NULL, 1);
	struct winlink		*wl = item->source.wl;
	struct session		*src_s = item->source.s;
	struct session		*dst_s = item->target.s;
	struct window_pane	*wp = item->source.wp;
	struct window		*w = wl->window;
	char			*name, *cause;
	int			 idx = item->target.idx;
	const char		*template;
	char			*cp;

	if (idx != -1 && winlink_find_by_index(&dst_s->windows, idx) != NULL) {
		cmdq_error(item, "index %d already in use", idx);
		return (CMD_RETURN_ERROR);
	}

	if (window_count_panes(w) == 1) {
		cmdq_error(item, "can't break with only one pane");
		return (CMD_RETURN_ERROR);
	}
	server_unzoom_window(w);

	TAILQ_REMOVE(&w->panes, wp, entry);
	window_lost_pane(w, wp);
	layout_close_pane(wp);

	w = wp->window = window_create(w->sx, w->sy);
	TAILQ_INSERT_HEAD(&w->panes, wp, entry);
	w->active = wp;

	if (!args_has(args, 'n')) {
		name = default_window_name(w);
		window_set_name(w, name);
		free(name);
	} else {
		window_set_name(w, args_get(args, 'n'));
		options_set_number(w->options, "automatic-rename", 0);
	}

	layout_init(w, wp);
	wp->flags |= PANE_CHANGED;

	if (idx == -1)
		idx = -1 - options_get_number(dst_s->options, "base-index");
	wl = session_attach(dst_s, w, idx, &cause); /* can't fail */
	if (!args_has(self->args, 'd')) {
		session_select(dst_s, wl->idx);
		cmd_find_from_session(current, dst_s, 0);
	}

	server_redraw_session(src_s);
	if (src_s != dst_s)
		server_redraw_session(dst_s);
	server_status_session_group(src_s);
	if (src_s != dst_s)
		server_status_session_group(dst_s);

	if (args_has(args, 'P')) {
		if ((template = args_get(args, 'F')) == NULL)