Пример #1
0
/**
 * c_get_window_name always returns a string, even if a window hasn't
 * got a name - use this function to determine if a window really has
 * a name or not.
 * returns a boolean true or false
 */
int c_get_window_has_name(lua_State *lua)
{
	int top = lua_gettop(lua);

	if (top != 0) {
		luaL_error(lua, "get_window_has_name: %s", no_indata_expected_error);
		return 0;
	}

	gboolean has_name = FALSE;

	WnckWindow *window = get_current_window();

	if (window) {
		has_name = wnck_window_has_name(window);
	}

	lua_pushboolean(lua, has_name);

	return 1;
}
Пример #2
0
/*
 * wnck_window_get_real_name
 *
 * Returns: const char * or NULL
 * Description: Wrapper function to either get the name of the window or
 * return NULL
 */
static const char *
wnck_window_get_real_name (WnckWindow *win)
{
    return wnck_window_has_name (win) ? wnck_window_get_name (win) : NULL;
}