当前位置: 首页>>代码示例>>C++>>正文


C++ put_status函数代码示例

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


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

示例1: remove_monitor

void remove_monitor(monitor_t *m)
{
	PRINTF("remove monitor %s (0x%X)\n", m->name, m->id);
	put_status(SBSC_MASK_MONITOR_REMOVE, "monitor_remove %s\n", m->name);

	while (m->desk_head != NULL)
		remove_desktop(m, m->desk_head);
	monitor_t *prev = m->prev;
	monitor_t *next = m->next;
	monitor_t *last_mon = history_get_monitor(m);
	if (prev != NULL)
		prev->next = next;
	if (next != NULL)
		next->prev = prev;
	if (mon_head == m)
		mon_head = next;
	if (mon_tail == m)
		mon_tail = prev;
	if (pri_mon == m)
		pri_mon = NULL;
	if (mon == m) {
		mon = (last_mon == NULL ? (prev == NULL ? next : prev) : last_mon);
		if (mon != NULL && mon->desk != NULL)
			update_current();
	}
	xcb_destroy_window(dpy, m->root);
	free(m);
	num_monitors--;
	put_status(SBSC_MASK_REPORT);
}
开发者ID:chasefarthing,项目名称:bspwm,代码行数:30,代码来源:monitor.c

示例2: remove_desktop

void remove_desktop(monitor_t *m, desktop_t *d)
{
	put_status(SBSC_MASK_DESKTOP_REMOVE, "desktop_remove %s %s\n", m->name, d->name);

	bool was_focused = (mon != NULL && d == mon->desk);
	bool was_active = (d == m->desk);
	history_remove(d, NULL, false);
	unlink_desktop(m, d);
	empty_desktop(m, d);
	free(d);

	ewmh_update_current_desktop();
	ewmh_update_number_of_desktops();
	ewmh_update_desktop_names();

	if (mon != NULL && m->desk != NULL) {
		if (was_focused) {
			update_focused();
		} else if (was_active) {
			activate_node(m, m->desk, m->desk->focus);
		}
	}

	put_status(SBSC_MASK_REPORT);
}
开发者ID:Dissonant-Tech,项目名称:bspwm,代码行数:25,代码来源:desktop.c

示例3: put_status

int internel_decoder::findandopencodec(AVCodecContext *pCodecCtx){


 AVCodec *codec;
codec=avcodec_find_decoder(pCodecCtx->codec_id);
cout <<"Codec:"<<codec->name<<endl;
if(codec==NULL) {
cout <<"Error Unsupported Codec..."<<endl;
   // sc->status = MP_ERROR;
   put_status(MP_ERROR,sc); 
  return -1; 
}

//avcodec_get_context_defaults3(pCodecCtx,codec);  

int ret;
pthread_mutex_lock(&sc->codec_open_lock);
ret = avcodec_open2(pCodecCtx, codec,NULL);
pthread_mutex_unlock(&sc->codec_open_lock); 
if(ret < 0){
  cout <<"Error Opening Codec..."<<endl;
 put_status(MP_ERROR,sc); 
  return -1;   
}

//sleep(1);
cout <<"Codec Opened..."<<endl; 
return 0;  
}
开发者ID:safiuddinkhan,项目名称:videoplayer,代码行数:29,代码来源:internels.cpp

示例4: add_monitor

void add_monitor(monitor_t *m)
{
	xcb_rectangle_t r = m->rectangle;

	if (mon == NULL) {
		mon = m;
		mon_head = m;
		mon_tail = m;
	} else {
		monitor_t *a = mon_head;
		while (a != NULL && rect_cmp(m->rectangle, a->rectangle) > 0) {
			a = a->next;
		}
		if (a != NULL) {
			monitor_t *b = a->prev;
			if (b != NULL) {
				b->next = m;
			} else {
				mon_head = m;
			}
			m->prev = b;
			m->next = a;
			a->prev = m;
		} else {
			mon_tail->next = m;
			m->prev = mon_tail;
			mon_tail = m;
		}
	}

	put_status(SBSC_MASK_MONITOR_ADD, "monitor_add 0x%08X %s %ux%u+%i+%i\n", m->id, m->name, r.width, r.height, r.x, r.y);

	put_status(SBSC_MASK_REPORT);
}
开发者ID:dj95,项目名称:bspwm,代码行数:34,代码来源:monitor.c

示例5: rename_monitor

void rename_monitor(monitor_t *m, const char *name)
{
	put_status(SBSC_MASK_MONITOR_RENAME, "monitor_rename 0x%08X %s %s\n", m->id, m->name, name);

	snprintf(m->name, sizeof(m->name), "%s", name);

	put_status(SBSC_MASK_REPORT);
}
开发者ID:dj95,项目名称:bspwm,代码行数:8,代码来源:monitor.c

示例6: rename_monitor

void rename_monitor(monitor_t *m, const char *name)
{
	put_status(SBSC_MASK_MONITOR_RENAME, "monitor_rename 0x%08X %s %s\n", m->id, m->name, name);

	snprintf(m->name, sizeof(m->name), "%s", name);
	xcb_icccm_set_wm_name(dpy, m->root, XCB_ATOM_STRING, 8, strlen(m->name), m->name);

	put_status(SBSC_MASK_REPORT);
}
开发者ID:gatulezal,项目名称:bspwm,代码行数:9,代码来源:monitor.c

示例7: do_show_variable

void do_show_variable(EditState *s, const char *name)
{
    char buf[MAX_FILENAME_SIZE];

    if (qe_get_variable(s, name, buf, sizeof(buf), NULL, 1) == VAR_UNKNOWN)
        put_status(s, "No variable %s", name);
    else
        put_status(s, "%s -> %s", name, buf);
}
开发者ID:Ivan1234,项目名称:qemacs,代码行数:9,代码来源:variables.c

示例8: rename_desktop

void rename_desktop(monitor_t *m, desktop_t *d, const char *name)
{

	put_status(SBSC_MASK_DESKTOP_RENAME, "desktop_rename 0x%08X 0x%08X %s %s\n", m->id, d->id, d->name, name);

	snprintf(d->name, sizeof(d->name), "%s", name);

	put_status(SBSC_MASK_REPORT);
	ewmh_update_desktop_names();
}
开发者ID:nas30,项目名称:bspwm,代码行数:10,代码来源:desktop.c

示例9: add_desktop

void add_desktop(monitor_t *m, desktop_t *d)
{
	put_status(SBSC_MASK_DESKTOP_ADD, "desktop_add %s %s\n", m->name, d->name);

	insert_desktop(m, d);
	ewmh_update_number_of_desktops();
	ewmh_update_desktop_names();
	ewmh_update_wm_desktops();
	put_status(SBSC_MASK_REPORT);
}
开发者ID:Dissonant-Tech,项目名称:bspwm,代码行数:10,代码来源:desktop.c

示例10: change_layout

void change_layout(monitor_t *m, desktop_t *d, layout_t l)
{
	d->layout = l;
	arrange(m, d);

	put_status(SBSC_MASK_DESKTOP_LAYOUT, "desktop_layout %s %s %s\n", m->name, d->name, l==LAYOUT_TILED?"tiled":"monocle");

	if (d == m->desk) {
		put_status(SBSC_MASK_REPORT);
	}
}
开发者ID:Dissonant-Tech,项目名称:bspwm,代码行数:11,代码来源:desktop.c

示例11: grab_pointer

bool grab_pointer(pointer_action_t pac)
{
	xcb_window_t win = XCB_NONE;
	xcb_point_t pos;

	query_pointer(&win, &pos);

	coordinates_t loc;

	if (!locate_window(win, &loc)) {
		if (pac == ACTION_FOCUS) {
			monitor_t *m = monitor_from_point(pos);
			if (m != NULL && m != mon && (win == XCB_NONE || win == m->root)) {
				focus_node(m, m->desk, m->desk->focus);
				return true;
			}
		}
		return false;
	}

	if (pac == ACTION_FOCUS) {
		if (loc.node != mon->desk->focus) {
			focus_node(loc.monitor, loc.desktop, loc.node);
			return true;
		} else if (focus_follows_pointer) {
			stack(loc.desktop, loc.node, true);
		}
		return false;
	}

	if (loc.node->client->state == STATE_FULLSCREEN) {
		return true;
	}

	xcb_grab_pointer_reply_t *reply = xcb_grab_pointer_reply(dpy, xcb_grab_pointer(dpy, 0, root, XCB_EVENT_MASK_BUTTON_RELEASE|XCB_EVENT_MASK_BUTTON_MOTION, XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC, XCB_NONE, XCB_NONE, XCB_CURRENT_TIME), NULL);

	if (reply == NULL || reply->status != XCB_GRAB_STATUS_SUCCESS) {
		free(reply);
		return true;
	}
	free(reply);

	if (pac == ACTION_MOVE) {
		put_status(SBSC_MASK_POINTER_ACTION, "pointer_action 0x%08X 0x%08X 0x%08X move begin\n", loc.monitor->id, loc.desktop->id, loc.node->id);
	} else if (pac == ACTION_RESIZE_CORNER) {
		put_status(SBSC_MASK_POINTER_ACTION, "pointer_action 0x%08X 0x%08X 0x%08X resize_corner begin\n", loc.monitor->id, loc.desktop->id, loc.node->id);
	} else if (pac == ACTION_RESIZE_SIDE) {
		put_status(SBSC_MASK_POINTER_ACTION, "pointer_action 0x%08X 0x%08X 0x%08X resize_side begin\n", loc.monitor->id, loc.desktop->id, loc.node->id);
	}

	track_pointer(loc, pac, pos);

	return true;
}
开发者ID:gyroninja,项目名称:bspwm,代码行数:54,代码来源:pointer.c

示例12: add_desktop

void add_desktop(monitor_t *m, desktop_t *d)
{
	put_status(SBSC_MASK_DESKTOP_ADD, "desktop_add 0x%08X %s 0x%08X\n", d->id, d->name, m->id);

	d->border_width = m->border_width;
	d->window_gap = m->window_gap;
	insert_desktop(m, d);
	ewmh_update_number_of_desktops();
	ewmh_update_desktop_names();
	ewmh_update_wm_desktops();
	put_status(SBSC_MASK_REPORT);
}
开发者ID:nas30,项目名称:bspwm,代码行数:12,代码来源:desktop.c

示例13: transfer_desktop

bool transfer_desktop(monitor_t *ms, monitor_t *md, desktop_t *d)
{
	if (ms == NULL || md == NULL || d == NULL || ms == md) {
		return false;
	}

	bool was_active = (d == ms->desk);

	unlink_desktop(ms, d);

	if (md->desk != NULL) {
		hide_desktop(d);
	}

	insert_desktop(md, d);
	history_transfer_desktop(md, d);

	if (was_active) {
		if (mon == ms) {
			focus_node(ms, NULL, NULL);
		} else {
			activate_node(ms, NULL, NULL);
		}
	}

	if (ms->sticky_count > 0 && was_active) {
		sticky_still = false;
		transfer_sticky_nodes(ms, d, ms->desk, d->root);
		sticky_still = true;
	}

	adapt_geometry(&ms->rectangle, &md->rectangle, d->root);
	arrange(md, d);

	if (md->desk == d) {
		if (mon == md) {
			focus_node(md, d, d->focus);
		} else {
			activate_node(md, d, d->focus);
		}
	}

	ewmh_update_wm_desktops();
	ewmh_update_desktop_names();
	ewmh_update_current_desktop();

	put_status(SBSC_MASK_DESKTOP_TRANSFER, "desktop_transfer 0x%08X 0x%08X 0x%08X\n", ms->id, d->id, md->id);
	put_status(SBSC_MASK_REPORT);

	return true;
}
开发者ID:nas30,项目名称:bspwm,代码行数:51,代码来源:desktop.c

示例14: activate_desktop

void activate_desktop(monitor_t *m, desktop_t *d)
{
	if (d == m->desk) {
		return;
	}

	show_desktop(d);
	hide_desktop(m->desk);

	m->desk = d;

	put_status(SBSC_MASK_DESKTOP_ACTIVATE, "desktop_activate %s %s\n", m->name, d->name);
	put_status(SBSC_MASK_REPORT);
}
开发者ID:Dissonant-Tech,项目名称:bspwm,代码行数:14,代码来源:desktop.c

示例15: swap_monitors

bool swap_monitors(monitor_t *m1, monitor_t *m2)
{
	if (m1 == NULL || m2 == NULL || m1 == m2) {
		return false;
	}

	put_status(SBSC_MASK_MONITOR_SWAP, "monitor_swap 0x%08X 0x%08X\n", m1->id, m2->id);

	if (mon_head == m1) {
		mon_head = m2;
	} else if (mon_head == m2) {
		mon_head = m1;
	}
	if (mon_tail == m1) {
		mon_tail = m2;
	} else if (mon_tail == m2) {
		mon_tail = m1;
	}

	monitor_t *p1 = m1->prev;
	monitor_t *n1 = m1->next;
	monitor_t *p2 = m2->prev;
	monitor_t *n2 = m2->next;

	if (p1 != NULL && p1 != m2) {
		p1->next = m2;
	}
	if (n1 != NULL && n1 != m2) {
		n1->prev = m2;
	}
	if (p2 != NULL && p2 != m1) {
		p2->next = m1;
	}
	if (n2 != NULL && n2 != m1) {
		n2->prev = m1;
	}

	m1->prev = p2 == m1 ? m2 : p2;
	m1->next = n2 == m1 ? m2 : n2;
	m2->prev = p1 == m2 ? m1 : p1;
	m2->next = n1 == m2 ? m1 : n1;

	ewmh_update_wm_desktops();
	ewmh_update_desktop_names();
	ewmh_update_desktop_viewport();
	ewmh_update_current_desktop();

	put_status(SBSC_MASK_REPORT);
	return true;
}
开发者ID:gatulezal,项目名称:bspwm,代码行数:50,代码来源:monitor.c


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